Anonymous user
Palindromic primes: Difference between revisions
m
→{{header|REXX}}: changed the GENP subroutine.
(Added Sidef) |
m (→{{header|REXX}}: changed the GENP subroutine.) |
||
Line 510:
@.1=2; @.2=3; @.3=5; @.4=7; @.5=11 /*define some low primes. */
!.2=1; !.3=1; !.5=1; !.7=1; !.11=1 /* " " " " flags. */
#=5;
/* [↓] generate more primes ≤ high.*/
do j=@.#+2 by 2 to hip /*find odd primes from here on. */
parse var j '' -1 _;
if j//3==0 then
do k=5 while sq.k<=j
if j // @.k == 0 then iterate j /*Is J ÷ X? Then not prime. ___ */
end /*k*/ /* [↑] only process numbers ≤ √ J */
#= #+1; @.#= j;
end /*j*/; return</lang>
{{out|output|text= when using the default inputs:}}
|