Primes whose first and last number is 3: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: note use of 'theory' module) |
(→{{header|Go}}: Added stretch goal.) |
||
Line 42: | Line 42: | ||
} |
} |
||
fmt.Println("\nFound", len(primes), "Such primes.") |
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> |
}</lang> |
||
Line 52: | Line 65: | ||
Found 33 Such primes. |
Found 33 Such primes. |
||
Found 2,251 primes under 1,000,000 which begin and end with 3. |
|||
</pre> |
</pre> |
||