Smallest square that begins with n: Difference between revisions
Content added Content deleted
m (added highlighting and added verbiage.) |
m (→{{header|REXX}}: changed program to not show the 50th number.) |
||
Line 173: | Line 173: | ||
#= 0 /*initialize the count of found numbers*/ |
#= 0 /*initialize the count of found numbers*/ |
||
idx= 1 |
idx= 1 |
||
$= |
$=; nn= n - 1 /*a list of additive primes (so far). */ |
||
do j=1 while #< |
do j=1 while #<nn /*keep searching 'til enough nums found*/ |
||
do k=1 until pos(j, k * k)==1 /*compute a square of some number. */ |
do k=1 until pos(j, k * k)==1 /*compute a square of some number. */ |
||
end /*k*/ |
end /*k*/ |
||
Line 197: | Line 197: | ||
21 │ 2,116 225 2,304 2,401 25 2,601 2,704 289 2,916 3,025 |
21 │ 2,116 225 2,304 2,401 25 2,601 2,704 289 2,916 3,025 |
||
31 │ 3,136 324 3,364 3,481 35,344 36 3,721 3,844 3,969 400 |
31 │ 3,136 324 3,364 3,481 35,344 36 3,721 3,844 3,969 400 |
||
41 │ 41,209 4,225 4,356 441 45,369 4,624 4,761 484 49 |
41 │ 41,209 4,225 4,356 441 45,369 4,624 4,761 484 49 |
||
</pre> |
</pre> |
||