4858450636189713423582095962494202044581400587983244549483093085061934704708809928450644769865524364849997247024915119110411605739177407856919754326571855442057210445735883681829823754139634338225199452191651284348332905131193199953502413758765239264874613394906870130562295813219481113685339535565290850023875092856892694555974281546386510730049106723058933586052544096664351265349363643957125565695936815184334857605266940161251266951421550539554519153785457525756590740540157929001765967965480064427829131488548259914721248506352686630476300


@鄙视下维基百科给出的k是错的

1. 我们绘制一个单色位图
2. 然后我们将位图转换为2进制数值
3. 逆向这个公式得到k
4. =.= 检查图形美不美

1. 打开个文本

2.上代码,tupper.txt就是上面的文件

 #!/usr/bin/env python
# -*- coding:utf-8 -*-
import math

def Base2_to_10(x):
ans = 0
i = 0
while x > 0:
if x%10 == 1: ans += 2**i
x /= 10
i += 1
return ans
def input():
bar = ""
for line in open('tupper.txt'):
for i in line[:-1]:
bar += i
code = ["" for i in xrange(17*107)]
for i in xrange(17*107-1):
#print i
x = i%107
y = 16- i/107
if bar[i] == "":
code[17*x+y] = ""
str = "".join(code)
return Base2_to_10(int(str[::-1]))*17
str = input()
print str

3 得到str

17395801135847186519514533766577166712920244599511619806806360198319443964624090437973069690063751432629635277541067512742591237154706476089604919941282726117482657226986792284460049763364287128660374652834353819138510460422151182573412890443751441495242184763277437223648251193921175808287491778837040326348124920816742193510432149378864985078857052059037920621670314430604882179347284818468370754314529752114472995398250019563369691397252465478396117000433401686853725151310746693542808908025107928533841248521147887035746484088


4.用官方的代码跑一下效果

 """
Copyright (c) 2012, 2013 The PyPedia Project, http://www.pypedia.com

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

# Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""

__pypdoc__ = """
Method: Tupper_self_referential_formula
Retrieve date: Tue, 11 Mar 2014 03:15:49 +0200

Plots the [http://en.wikipedia.org/wiki/Tupper's_self-referential_formula Tupper's_self-referential_formula]:
: ${1\over 2} < \left\lfloor \mathrm{mod}\left(\left\lfloor {y \over 17} \right\rfloor 2^{-17 \lfloor x \rfloor - \mathrm{mod}(\lfloor y\rfloor, 17)},2\right)\right\rfloor$

The plot is the very same formula that generates the plot.

[[Category:Validated]]
[[Category:Algorithms]]
[[Category:Math]]
[[Category:Inequalities]]

"""

def Tupper_self_referential_formula():
k = 17395801135847186519514533766577166712920244599511619806806360198319443964624090437973069690063751432629635277541067512742591237154706476089604919941282726117482657226986792284460049763364287128660374652834353819138510460422151182573412890443751441495242184763277437223648251193921175808287491778837040326348124920816742193510432149378864985078857052059037920621670314430604882179347284818468370754314529752114472995398250019563369691397252465478396117000433401686853725151310746693542808908025107928533841248521147887035746484088
#love yiran

def f(x,y):
d = ((-17 * x) - (y % 17))
e = reduce(lambda x,y: x*y, [2 for x in range(-d)]) if d else 1
f = ((y / 17) / e)
g = f % 2
return 0.5 < g

for y in range(k+16, k-1, -1):
line = ""
for x in range(0, 107):
if f(x,y):
line += "@"
else:
line += " "
print line

#Method name =Tupper_self_referential_formula()
if __name__ == '__main__':
# print __pypdoc__

returned = Tupper_self_referential_formula()
if returned:
print str(returned)

Tupper_self_referential_formula.py

5.得到效果

love 依然~~

http://www.matrix67.com/blog/archives/301

http://zh.wikipedia.org/wiki/%E5%A1%94%E7%8F%80%E8%87%AA%E6%8C%87%E5%85%AC%E5%BC%8F

## 用Tupper自我指涉公式造图的更多相关文章

1. Tupper自我指涉公式生成器

2. 志愿者招募 HYSBZ - 1061（公式建图费用流）

转自神犇:https://www.cnblogs.com/jianglangcaijin/p/3799759.html 题意:申奥成功后,布布经过不懈努力,终于 成为奥组委下属公司人力资源部门的主管. ...

3. 【seo】title / robots / description / canonical

1.title title,就是浏览器上显示的那些内容,不仅用户能看到,也能被搜索引擎检索到(搜索引擎在抓取网页时,最先读取的就是网页标题,所以title是否正确设置极其重要. 1)title一般不超 ...

4. 机器学习&amp;数据挖掘笔记_20（PGM练习四：图模型的精确推理）

前言: 这次实验完成的是图模型的精确推理.exact inference分为2种,求边缘概率和求MAP,分别对应sum-product和max-sum算法.这次实验涉及到的知识点很多,不仅需要熟悉图模 ...

5. Effective C++_笔记_条款11_在operator=中处理“自我赋值”

(整理自Effctive C++,转载请注明.整理者:华科小涛@http://www.cnblogs.com/hust-ghtao/) 为什么会出现自我赋值呢?不明显的自我赋值,是“别名”带来的结果: ...

6. SVG的动态之美-搜狗地铁图重构散记

搜狗地图发布了新版的移动端地铁图,改版初衷是为了用户交互体验的提升以及性能的改善.原版地铁图被用户吐槽最多的是pinch缩放不流畅.无过渡动画.拖拽边界不合理等等,大体上都是交互体验上的问题.实际上原 ...

7. 定义工作，解读自我——IT帮2019年2月线下活动回顾

本次活动是在北京和深圳两个分站同步进行的,IT团建委员会负责策划和组织,北京站由帮主周老师.王兵老师主导,深圳站由副帮主兼深圳站长陈焕老师主导. 几位老师都是有着丰富的工作经历和人生体验的导师,他们不 ...

8. Spark学习之路 （二十七）图简介

一.图 1.1 基本概念 图是由顶点集合(vertex)及顶点间的关系集合(边edge)组成的一种数据结构. 这里的图并非指代数中的图.图可以对事物以及事物之间的关系建模,图可以用来表示自然发生的连接 ...

9. Spark（十七）图计算GraphX

一.图概念术语 1.1 基本概念 图是由顶点集合(vertex)及顶点间的关系集合(边edge)组成的一种数据结构. 这里的图并非指代数中的图.图可以对事物以及事物之间的关系建模,图可以用来表示自然发 ...

## 随机推荐

1. Webview组件和HTML的介绍

Deviceone平台并不是基于html5的跨平台开发工具.我们开发一个app都是使用原生的组件,但是在某些场景下html5也是非常好的选择,比如复杂的图文混排(类似新闻),比如报表chart之类用h ...

2. JavaScript的几种继承方式

看<JavaScript高级程序设计>做的一些笔记 ECMAScript只支持实现继承,不支持接口继承(因为函数没有签名) 原型链(实现继承的主要方法): function SuperTy ...

3. svn 服务器不能看log问题

Subversion “show log” is offline 1.将/srv/svn/repos/ path svnserve.conf 里的 none-access = read 修改为none ...

4. Intellij IDEA @Override 标红

Intellij IDEA 升级到15之后,之前那些@Override 的都标红,提示@Override is not allowed when implement interface method ...

5. Brief introduction to Java String Split 【简单介绍下Java String Split】

Split is a common function in Java. It split a full string to an array based on delimeter. For examp ...

6. 【JavaScript制作页面时常用的五个特效，你用到了哪个？】

常用的五个特效的相关知识点见附录(五道例题后有附录哦~): 例一: 1.在某页面中有一个图片和五个超链接,如下图所示: 单击不同的数字超链接显示不同的图片: 图1 图片幻灯片显示效果 提示: (1)默 ...

7. 《Android进阶之光》--多线程编程

No1: 实现多线程的3中方法 1)继承Thread,重写run()方法 2)实现Runnable接口,并实现该接口的run()方法 3)实现Callable接口,重写call()方法 public ...

8. Python fcntl 与 signal 模块使用

这两个模块是Python标准库里面就包含的模块 用法介绍在 https://docs.python.org/2/library/signal.html https://docs.python.org/ ...

9. WebApi 文档Swagger

NET WebApi 文档Swagger中度优化   本文版权归博客园和作者吴双本人共同所有,转载和爬虫请注明原文地址:www.cnblogs.com/tdws   写在前面 在后台接口开发中,接口文 ...

10. np.argsort函数

np.argsort函数 觉得有用的话,欢迎一起讨论相互学习~Follow Me numpy.argsort(a, axis=-1, kind='quicksort', order=None) 功能: ...