Primes whose first and last number is 3: Difference between revisions
Primes whose first and last number is 3 (view source)
Revision as of 16:06, 24 July 2021
, 2 years ago→{{header|Go}}: Added stretch goal.
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: note use of 'theory' module) |
(→{{header|Go}}: Added stretch goal.) |
||
Line 42:
}
fmt.Println("\nFound", len(primes), "Such primes.")
pc := len(primes)
for i := 30003; i <= 39993; i += 10 {
if rcu.IsPrime(i) {
pc++
}
}
for i := 300003; i <= 399993; i += 10 {
if rcu.IsPrime(i) {
pc++
}
}
pcc := rcu.Commatize(pc)
fmt.Println("\nFound", pcc, "primes under 1,000,000 which begin and end with 3.")
}</lang>
Line 52 ⟶ 65:
Found 33 Such primes.
Found 2,251 primes under 1,000,000 which begin and end with 3.
</pre>
|