login
A352965
A variant of Van Eck's sequence where we only consider prime numbers: for n >= 0, if a(n) = a(n-p) for some prime number p, take the least such p and set a(n+1) = p; otherwise a(n+1) = 0. Start with a(1) = 0.
0
0, 0, 0, 2, 0, 2, 2, 3, 0, 7, 0, 2, 5, 0, 3, 7, 0, 3, 3, 11, 0, 7, 0, 2, 17, 0, 3, 19, 0, 3, 3, 13, 0, 7, 0, 2, 29, 0, 3, 31, 0, 3, 3, 13, 0, 7, 0, 2, 41, 0, 3, 43, 0, 3, 3, 13, 0, 7, 0, 2, 53, 0, 3, 0, 2, 5, 53, 0, 11, 0, 2, 11, 3, 19, 0, 5, 0, 2, 7, 0, 3, 73
OFFSET
1,4
COMMENTS
Will every prime number appear in the sequence?
EXAMPLE
a(1) = 0 by definition.
a(2) = 0 as there is only one occurrence of a(1) = 0 so far.
a(3) = 0 as a(2) <> a(2-p) for any admissible prime p.
a(4) = 2 as a(3) = a(3-2).
a(5) = 0 as there is only one occurrence of a(4) = 2 so far.
a(6) = 2 as a(5) = a(5-2).
a(7) = 2 as a(6) = a(6-2).
a(8) = 3 as a(7) <> a(7-2) and a(7) = a(7-3).
PROG
(PARI) { for (n=1, #a=vector(82), forprime (p=2, n-2, if (a[n-1]==a[n-1-p], a[n]=p; break)); print1 (a[n]", ")) }
CROSSREFS
Cf. A181391.
Sequence in context: A366353 A366354 A144741 * A103615 A308167 A293665
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 15 2022
STATUS
approved