OFFSET
1,1
COMMENTS
PROG
(PARI) v(n) = my(v=[0], k, flag=1); for(i=2, n+1, k=(v[#v]^2+v[#v]+1)%n; v=concat(v, k); for(j=1, i-1, if(v[j]==k, flag=0)); if(flag==0, break())); v
a(n) = isprime(n) && !(v(n)[#v(n)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Oct 26 2019
STATUS
approved