Anonymous user
Multi-base primes: Difference between revisions
m
→{{header|REXX}}: changed some comments.
m (→{{header|Pascal}}: Forget to inc number in IncInBaseDigits and to reset all digits to 0 in CnvtoBASE) |
m (→{{header|REXX}}: changed some comments.) |
||
Line 1,271:
say
say; say center(' 'word(names, w)"─character numbers that are" ,
'prime in the most bases: ('cnt "bases) ", 101,
do n=bot to top; y= words($.w.n)
if y==cnt then say n '──►' strip($.w.n)
end /*n*/
end /*w*/
Line 1,284:
end /*k*/; return z || substr(@, x+1, 1)
/*──────────────────────────────────────────────────────────────────────────────────────*/
genP:
do j=@.#+2 by 2 to 2 * 36 * 10**widths /*find odd primes from here on. */
parse var j '' -1 _; if
if j//3==0 then
do k=5 while sq.k<=j
end /*k*/ /* [↑] only process numbers ≤ √ J */
#= # + 1; @.#= j;
end /*j*/;
{{out|output|text= when using the default input:}}
<pre>
|