OFFSET
0,2
COMMENTS
This yields the prime factors of numbers of the form N^2+1, cf. formula in A089120: For n=0,1,2,... check whether N = +/- a(n) [mod 2*A002313(n+1)], if so, then A002313(n+1) is a prime factor of N^2+1.
Obviously, p then divides (2kp +/- a(n))^2+1 for all k >=0 ; in particular it will be the least prime factor of such numbers if there is no earlier match.
FORMULA
PROG
(PARI) /* for illustrative purpose: a(n) is the smaller of the 2 possible remainders mod 2*p of numbers N such that N^2+1 has p as smallest prime factor */ forprime( p=1, 199, p>2 & p%4 != 1 & next; my(c=[]); for(i=1, 9e9, factor(i^2+1)[1, 1]==p |next; c=vecsort(concat(c, i%(2*p)), , 8); #c==1 || print1(", "c[1]) || break))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Mar 11 2012
STATUS
approved