File:Ulam4004001.png
来自Wikimedia Commons
跳转到导航
跳转到搜索
本预览的尺寸:600 × 600像素。 其他分辨率:240 × 240像素 | 480 × 480像素 | 768 × 768像素 | 1,024 × 1,024像素 | 2,048 × 2,048像素 | 4,001 × 4,001像素。
原始文件 (4,001 × 4,001像素,文件大小:687 KB,MIME类型:image/png)
文件信息
结构化数据
说明
摘要
[编辑]描述Ulam4004001.png |
English: An Ulam Spiral for numbers from 1 to 16008001. Note that in this picture, the number 1 is coloured black even though it is, by convention, not prime. Also, note that the image is rotated by 90 degrees clockwise when compared with this picture. |
日期 | |
来源 | 自己的作品 |
作者 | Purpy Pupple |
许可协议
[编辑]我,本作品著作权人,特此采用以下许可协议发表本作品:
本文件采用知识共享署名-相同方式共享 3.0 未本地化版本许可协议授权。
- 您可以自由地:
- 共享 – 复制、发行并传播本作品
- 修改 – 改编作品
- 惟须遵守下列条件:
- 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
- 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
已授权您依据自由软件基金会发行的无固定段落及封面封底文字(Invariant Sections, Front-Cover Texts, and Back-Cover Texts)的GNU自由文件许可协议1.2版或任意后续版本的条款,复制、传播和/或修改本文件。该协议的副本请见“GNU Free Documentation License”。http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
您可以选择您需要的许可协议。
Matlab Code
[编辑]The image was generated with MATLAB in 1600 seconds. Here's my remarkably clunky and inefficient code:
function spiral
n=2000;
A=zeros(2*n+1);
B=A;
x=n+1;
y=x;
A(x,y)=true;
B(x,y)=true;
direction=1;
for i=2:(2*n+1)^2
switch direction
case 1
x=x+1;
B(x,y)=true;
A(x,y)=isprime(i);
if ~B(x,y+1)
direction=2;
end
case 2
y=y+1;
B(x,y)=true;
A(x,y)=isprime(i);
if ~B(x-1,y)
direction=3;
end
case 3
x=x-1;
B(x,y)=true;
A(x,y)=isprime(i);
if ~B(x,y-1)
direction=4;
end
case 4
y=y-1;
B(x,y)=true;
A(x,y)=isprime(i);
if ~B(x+1,y)
direction=1;
end
end
end
imwrite(imresize(~A,3,'nearest'),['output' num2str(n) '.png'],'png');
end
文件历史
点击某个日期/时间查看对应时刻的文件。
日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
---|---|---|---|---|---|
当前 | 2011年2月3日 (四) 03:28 | 4,001 × 4,001(687 KB) | Dllu(留言 | 贡献) | Resized back to the correct size (the original uploaded version was needlessly enlarged by 3x) | |
2010年12月24日 (五) 08:11 | 12,003 × 12,003(1.15 MB) | Dllu(留言 | 贡献) | {{Information |Description={{en|1=An Ulam Spiral for numbers from 1 to 4004001.}} |Source={{own}} |Author=Purpy Pupple |Date=2010-12-23 |Permission= |other_versions= }} |
您不可以覆盖此文件。
文件用途
没有页面使用本文件。
全域文件用途
以下其他wiki使用此文件:
- zh.wikipedia.org上的用途