OFFSET
1,1
COMMENTS
Essentially the same as A245177. - R. J. Mathar, Nov 25 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..4000
FORMULA
Any individual prime p is easily tested for membership in this set by iterating the recurrence for A000085 mod p, T(n) = T(n-1) + (n-1)T(n-2) modulo p, until either finding a value divisible by p or entering a cycle.
EXAMPLE
MAPLE
filter:= proc(p) local a, b, c, n, R;
if not isprime(p) then return false fi;
a:= 1; b:= 1;
R[1, 1, 1]:= 1;
for n from 2 do
c:= a + (n-1)*b mod p;
if c = 0 then return true fi;
b:= a; a:= c;
if R[a, b, (n mod p)] = 1 then return false fi;
R[a, b, (n mod p)]:= 1;
od:
end proc:
select(filter, [2, seq(i, i=3..1000, 2)]); # Robert Israel, Nov 22 2015
MATHEMATICA
A85 = DifferenceRoot[Function[{y, n}, {(-n - 1) y[n] - y[n + 1] + y[n + 2] == 0, y[1] == 1, y[2] == 2}]];
selQ[p_] := AnyTrue[Range[p - 1], Divisible[A85[#], p]&]; selQ[2] = True;
Reap[For[p = 2, p < 1000, p = NextPrime[p], If[selQ[p], Print[p]; Sow[p] ]]][[2, 1]] (* Jean-François Alcover, Jul 28 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Eppstein, Nov 22 2015
STATUS
approved