Smarandache prime-digital sequence: Difference between revisions

Content added Content deleted
Line 683: Line 683:
main = do
main = do
printf "The first 25 SPDS:\n%s\n\n" $ f smarandache
printf "The first 25 SPDS:\n%s\n\n" $ f smarandache
mapM_ (uncurry (printf "The %8sth SPDS: %15s\n")) $
mapM_ (uncurry (printf "The %9sth SPDS: %15s\n")) $
nextSPDSTerms [100, 1_000, 10_000, 100_000]
nextSPDSTerms [100, 1_000, 10_000, 100_000, 1_000_000]
where f = show . take 25</lang>
where f = show . take 25</lang>
{{out}}
{{out}}
<pre>
<pre>The first 25 SPDS:
The first 25 SPDS:
[2,3,5,7,23,37,53,73,223,227,233,257,277,337,353,373,523,557,577,727,733,757,773,2237,2273]
[2,3,5,7,23,37,53,73,223,227,233,257,277,337,353,373,523,557,577,727,733,757,773,2237,2273]


The 100th SPDS: 33,223
The 100th SPDS: 33,223
The 1,000th SPDS: 3,273,527
The 1,000th SPDS: 3,273,527
The 10,000th SPDS: 273,322,727
The 10,000th SPDS: 273,322,727
The 100,000th SPDS: 23,325,232,253
The 100,000th SPDS: 23,325,232,253
The 1,000,000th SPDS: 753,373,253,723
./smarandache_optimized 1.20s user 0.04s system 80% cpu 1.531 total
./smarandache_optimized 15.25s user 0.45s system 98% cpu 15.938 total</pre>
</pre>


=={{header|J}}==
=={{header|J}}==