Quadrat special primes: Difference between revisions
Content added Content deleted
(Added Sidef) |
m (→{{header|REXX}}: changed some comments and whitespace.) |
||
Line 477: | Line 477: | ||
sqp= 0; idx= 1 /*initialize number of sqp and index.*/ |
sqp= 0; idx= 1 /*initialize number of sqp and index.*/ |
||
op= 1 |
op= 1 |
||
$= /* |
$= /*list of quad─special primes (so far).*/ |
||
do j=0 by 0 |
do j=0 by 0 |
||
do k=1 until !.np; np= op + k*k /*find the next square + oldPrime.*/ |
do k=1 until !.np; np= op + k*k /*find the next square + oldPrime.*/ |
||
Line 486: | Line 486: | ||
if cols<0 then iterate /*Build the list (to be shown later)? */ |
if cols<0 then iterate /*Build the list (to be shown later)? */ |
||
c= commas(np) /*maybe add commas to the number. */ |
c= commas(np) /*maybe add commas to the number. */ |
||
$= $ right(c, max(w, length(c) ) ) /*add |
$= $ right(c, max(w, length(c) ) ) /*add quadratic─special prime ──► list.*/ |
||
if sqp//cols\==0 then iterate /*have we populated a line of output? */ |
if sqp//cols\==0 then iterate /*have we populated a line of output? */ |
||
say center(idx, 7)'│' substr($, 2); $= /*display what we have so far (cols). */ |
say center(idx, 7)'│' substr($, 2); $= /*display what we have so far (cols). */ |