OFFSET
1,3
COMMENTS
The nonprime integers and the prime numbers appear in their natural order.
LINKS
Eric Angelini, Same gaps pattern, Personal blog "Cinquante signes", Sept 2023.
EXAMPLE
Sequence read as a succession of terms:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 11, 15, 16, ...
The gaps between nonprime terms are of size:
0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ...
Sequence read as a succession of digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 2, 1, 4, 1, 1, 1, 5, 1, 6, ...
The gaps between nonprime digits are of size:
0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ...
MATHEMATICA
a[1]=0; a[n_]:=a[n]=(k=1; While[MemberQ[s=Array[a, n-1], k]||PrimeQ@k!= PrimeQ[Flatten[IntegerDigits/@Join[s, {k}]][[n]]], k++]; k); Array[a, 70] (* Giorgos Kalogeropoulos, Sep 07 2023 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Sep 07 2023
STATUS
approved