Hi
There has been a recent Numberfile video re new investigations into
the sequence of the last digits of prime numbers. It has been know for
Some time that the possible candidates (1, 3, 7, 9) are not present in
Equable amounts, and there has recently been a new discovery which
Supposes that certain of the prime endings have a bias to what the next
Ending might be.
In order to follow this discovery I have written the following J program that
Runs through a given number of primes and tabulates the amount of prime
Endings. This is the first step before I consider biases in following primes.
This is the program I am using:
1#.'1379'=/>{.each |.each ":each p:i.1000000
249934 250110 250014 249940
It seems to produce the correct results but I am sure there must be a
Better (and no doubt faster) way to do this calculation.
I'm sure I don't need three 'eachs' but can't find a way round it.
Grateful for any help,
Thanks in advance,
Richard