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
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 15 2022
STATUS
approved