OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 47 is in the sequence because the 4 consecutive primes starting with 47 are 47, 53, 59, 61, and their final digits 7,3,9,1 are a permutation of 1,3,7,9.
MAPLE
P:= select(isprime, [seq(i, i=3..2000, 2)]):
P1:= P mod 10:
P[select(i -> convert(P1[i..i+3], set) = {1, 3, 7, 9}, [$1..nops(P)-3])];
MATHEMATICA
Select[Partition[Prime[Range[300]], 4, 1], Sort[Mod[#, 10]] == {1, 3, 7, 9} &][[;; , 1]] (* Amiram Eldar, Aug 19 2022 *)
PROG
(Python)
from sympy import nextprime
from itertools import islice
def agen(): # generator of terms
p = [2, 3, 5, 7]
while True:
if set(map(lambda x: x%10, p)) == {1, 3, 7, 9}: yield p[0]
p = p[1:] + [nextprime(p[-1])]
print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 18 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Aug 18 2022
STATUS
approved