Cuban primes: Difference between revisions
Content added Content deleted
m (added wording to the task's preamble.) |
m (→{{header|REXX}}: changed a glyph in a comment.) |
||
Line 1,248: | Line 1,248: | ||
#= 3 /*above are needed for prime generation*/ |
#= 3 /*above are needed for prime generation*/ |
||
N= abs(N) /*use absolute value of N from now on*/ |
N= abs(N) /*use absolute value of N from now on*/ |
||
if #<N then /* [ |
if #<N then /* [↓] ending digs that aren't cubans.*/ |
||
do j=4 until #=>N; x= (j+1)**3 - j**3 /*compute a possible cuban*/ |
do j=4 until #=>N; x= (j+1)**3 - j**3 /*compute a possible cuban*/ |
||
parse var x '' -1 _; if !._ then iterate /*check for the last digit*/ |
parse var x '' -1 _; if !._ then iterate /*check for the last digit*/ |