Jump to content

Cuban primes: Difference between revisions

m
→‎{{header|Python}}: appears to be a transcription typo, looks ok now, warning removed
(→‎{{header|Python}}: flagged as incorrect, Python shows numbers that aren't cuban primes, and is missing others.)
m (→‎{{header|Python}}: appears to be a transcription typo, looks ok now, warning removed)
Line 904:
 
=={{header|Python}}==
 
{{incorrect|Python| <br><br> '''91''' &nbsp; (among others) &nbsp; is not a cuban prime, <br> '''1,027''' &nbsp; (among others) &nbsp; is missing from the output list. <br><br> Also, the 100,000<sup>th</sup> cuban prime is incorrect. <br><br>}}
 
{{trans|C#}}
Line 929 ⟶ 927:
st = datetime.datetime.now()
 
for i in range(01, int(math.pow(2,20))):
found = False
u += 6
v += u
mx = int(math.sqrt(uv))
for item in primes:
Line 979 ⟶ 977:
 
{{out}}
<pre>The first 200 cuban primes:
<pre>
7 19 37 61 127 271 331 397 547 631
The first 200 cuban primes:
919 7 1,657 19 1,801 1,951 37 2,269 61 2,437 91 127 2,791 3,169 217 271 3,571 3314,219
4,447 397 5,167 547 5,419 6316,211 7,057 817 919 17,027351 18,261269 19,387241 110,657 267 111,801719
112,951 097 213,269267 213,437669 216,791651 319,169441 319,571927 322,781447 423,219497 424,447 571 425,681117
526,167 227 527,419361 633,211391 735,057317 742,351841 745,957757 847,269251 849,587537 950,241 311 955,577897
1059,267221 1060,981919 1165,719269 1270,097687 1273,871477 1374,267419 1375,669367 1481,491181 1682,651171 1787,557211
1888,019237 1889,961269 1992,441401 1996,927661 21102,421121 22103,447231 22104,969347 23110,497017 24112,571 327 25114,117661
26115,227 837 26126,791691 27129,361169 30131,301671 30135,907469 31140,519617 32144,761541 33145,391861 34151,669 201 35155,317269
37163,969 567 39169,331219 40170,021 647 42176,127419 42180,841811 44189,287757 45200,757467 47202,251021 48213,007 067 49231,537019
50234,311 361 52241,669 117 53246,467247 55251,897431 58260,381191 59263,221737 60267,919 307 61276,777337 62279,641991 64283,387669
65285,269 517 68292,857969 70296,687731 73298,477621 74310,419087 75329,367677 77333,281667 81337,181681 82347,171 821 84351,169919
87360,211187 88368,237551 89372,269769 92374,401887 95377,587011 96383,661419 98387,827 721 99398,919581 102407,121377 103423,231001
104436,347627 106452,597797 110459,017817 112476,327407 114478,661801 115493,837291 118522,207919 119527,401941 124553,237411 126574,691219
129584,169767 131590,671077 132592,931741 135595,469411 138603,031457 140608,617851 141611,919557 144619,541711 145627,861919 147650,187071
149658,857477 151666,201937 155689,269761 160692,777641 163698,567419 164707,971131 166733,381591 169742,219519 170760,647537 173769,521627
176772,419669 180784,811897 183791,769047 185812,257761 189825,757301 200837,467937 202847,021477 205863,147497 213879,067667 217886,891177
222895,769987 224909,407151 227915,701769 229925,357741 231929,019077 234932,361419 241939,117121 242952,821597 246972,247991 251976,431411
253986,171707 260990,191151 263997,737057 1,021,417 2651,519024,921 2671,035,307469 2701,901074,607 2761,085,337407 2791,110,991817 2831,669 285114,517471
1,125,469 2891,231155,061 2911,177,097507 2921,181,969269 2961,215,731397 2981,253,621887 3101,281,087187 3121,019 285,111 3151,901324,681 3191,807 323328,737671
1,372,957 3291,677 409,731 3331,667422,097 3371,426,681231 3431,442,747827 3471,451,821161 3511,480,919519 3601,187 484,737 3621,269527,247 3681,551 372570,769357
374,887 377,011 383,419 387,721 392,047 398,581 405,169 407,377 420,751 423,001
Progress to the 100,000th cuban prime:..................................................
The 100,000th cuban prime is 3911,406792,072617,461147,127
Computation time was 7856 seconds</pre>
</pre>
 
=={{header|REXX}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.