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 未在地化版本授權條款。
- 您可以自由:
- 分享 – 複製、發佈和傳播本作品
- 重新修改 – 創作演繹作品
- 惟需遵照下列條件:
- 姓名標示 – 您必須指名出正確的製作者,和提供授權條款的連結,以及表示是否有對內容上做出變更。您可以用任何合理的方式來行動,但不得以任何方式表明授權條款是對您許可或是由您所使用。
- 相同方式分享 – 如果您利用本素材進行再混合、轉換或創作,您必須基於如同原先的相同或兼容的條款,來分布您的貢獻成品。
已授權您依據自由軟體基金會發行的無固定段落、封面文字和封底文字GNU自由文件授權條款1.2版或任意後續版本,對本檔進行複製、傳播和/或修改。該協議的副本列在GNU自由文件授權條款中。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 的使用狀況