OFFSET
1,2
COMMENTS
The prime digits are 2, 3, 5 and 7. This is not a permutation of the natural numbers as 100 and 101 cannot be part of the sequence, for instance.
EXAMPLE
a(5) = 5 jumps over 5 digits and lands on the first 2 of 22, a prime digit;
a(6) = 6 jumps over 6 digits and lands on the 2 of 23, a prime digit;
a(7) = 7 jumps over 7 digits and lands on the 2 of 25, a prime digit;
a(8) = 8 jumps over 8 digits and lands on the 2 of 27, a prime digit;
a(9) = 20: the 2 of 20 jumps over 2 digits and lands on the last 2 of 22, a prime digit;
a(9) = 20: the 0 of 20 jumps over 0 digit and lands on the first 2 of 22, a prime digit; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[MemberQ[ar=Array[a, n-1], k]||(vp=Flatten[IntegerDigits/@Join[ar, {k}]];
And@@(PrimeQ@Union@Table[If[IntegerQ[s=vp[[k+1+vp[[k]]]]], s, 2], {k, Length@vp}])
)==False, k++]; k); Array[a, 75]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Giorgos Kalogeropoulos, Oct 25 2023
STATUS
approved