Anonymous user
Primes whose first and last number is 3: Difference between revisions
Primes whose first and last number is 3 (view source)
Revision as of 13:16, 24 July 2021
, 2 years ago→{{header|REXX}}: changed "ending" to "trailing" (decimal digit).
m (→{{header|REXX}}: added highlighting to the REXX section header.) |
m (→{{header|REXX}}: changed "ending" to "trailing" (decimal digit).) |
||
Line 105:
call genP /*build array of semaphores for primes.*/
w= 10 /*width of a number in any column. */
title= ' primes N (in base ten) that have a leading and
" where N < " commas(hi)
if cols>0 then say ' index │'center(title, 1 + cols*(w+1) )
Line 116:
if Td\==dig then iterate /* " " " " trailing ? ? */ /* ◄■■■■■■■ a filter.*/
found= found + 1 /*bump the number of primes found. */
if cols<=
c= commas(@.j) /*maybe add commas to the number. */
$= $ right(c, max(w, length(c) ) ) /*add a prime ──► $ list, allow big #*/
Line 146:
{{out|output|text= when using the default inputs:}}
<pre>
index │
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 3 313 353 373 383 3,023 3,083 3,163 3,203 3,253
Line 154:
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────
Found 33 primes N (in base ten) that have a leading and
</pre>
{{out|output|text= when using the default inputs of: <tt> 1000000 -1 </tt>}}
<pre>
Found 2,251 primes N (in base ten) that have a leading and
</pre>
|