A328452 Primes p such that p=prime(k), prime(k+1), and prime(k+2) end in the same digit.
1627, 3089, 4297, 4831, 6481, 6793, 8543, 11027, 11867, 13421, 13649, 14177, 17509, 17807, 18839, 18859, 20359, 20411, 22501, 22511, 22963, 22973, 24923, 25189, 26449, 26459, 27367, 27541, 28309, 29443, 29453, 31081, 32203, 32381, 34919, 35171, 35281, 36343, 36353, 37087, 37223, 37243, 38923
Offset: 1
Examples
(p,q,r) = (1627,1637,1657), are three primes which are consecutive and end in the same digit. Hence, p=1627 is a member of this sequence.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Magma
f:=func
; a:=[]; for p in PrimesUpTo(40000) 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
-
Maple
q:= 3: r:= 5: count:= 0: R:= NULL: while count < 100 do p:= q; q:= r; r:= nextprime(r); if p-q mod 10 = 0 and q-r mod 10 = 0 then count:= count+1; R:= R, p; fi od: R; # Robert Israel, May 08 2020
-
Mathematica
First /@ Select[Partition[Prime@ Range@ 4105, 3, 1], Length@ Union@ Mod[#, 10] == 1 &] (* Giovanni Resta, Oct 16 2019 *)
-
PARI
isok(p) = {if (isprime(p), my(d = p % 10); my(q = nextprime(p+1), r = nextprime(q+1)); (d == (q % 10)) && (d == (r % 10)););} \\ Michel Marcus, Oct 17 2019