OFFSET
1,1
COMMENTS
Starts off the same as A031928, primes p such that the next prime is p + 10. First term that differs is 887, since 897 = 3 * 13 * 23 and the next prime is 907.
As the primes get larger and more sparsely distributed, the difference between successive primes is less likely to be less than 10.
One might expect that a prime is 1/4 as likely to be followed by a prime with the same least significant digit in base 10 (since the possibilities are 1, 3, 7, 9).
One might also expect this sequence to consist of a quarter of the primes. And yet pi(a(50)) = pi(3547) = 497; the 200th prime is 1223.
LINKS
Marius A. Burtea, Table of n, a(n) for n = 1..5005
Evelyn Lamb, "Peculiar Pattern Found in 'Random' Prime Numbers", Nature, March 14, 2016, republished by Scientific American.
Robert J. Lemke Oliver and Kannan Soundararajan, Unexpected biases in the distribution of consecutive primes, arXiv preprint arXiv:1603.03720 [math.NT], submitted on March 11, 2016.
FORMULA
EXAMPLE
139 is in the sequence because the immediately following prime is 149, which also ends in 9.
But 149 is not in the sequence because the next prime after that one is 151, which ends in 1, not 9.
MATHEMATICA
Select[Partition[Prime[Range[500000]], 2, 1], Mod[#[[1]], 10] == Mod[#[[2]], 10] &][[All, 1]] ( * Harvey P. Dale, Aug 21 2017 *)
Module[{nn=500000, prs, p}, prs=Prime[Range[nn]]; p=Divisible[#, 10]&/@ Differences[prs]; Pick[Most[prs], p]] (* Harvey P. Dale, Aug 22 2017 *)
PROG
(Magma) f:=func<p, m|p mod 10 eq m and NextPrime(p) mod 10 eq m>; a:=[]; for p in PrimesUpTo(4000) do if f(p, 1) or f(p, 3) or f(p, 7) or f(p, 9) then Append(~a, p); end if; end for; a; // Marius A. Burtea, Oct 16 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alonso del Arte, Aug 06 2017
STATUS
approved