OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (terms 1..150 from Klaus Brockhaus)
EXAMPLE
a(3) = 1985 since A002144(3) = 17, 1985^2 + 1 = 3940226 = 2*17^3*401 and for no k < 1985 does 17^3 divide k^2+1.
PROG
(PARI) {m=12000000; pmax=300; z=70; v=vector(z); for(n=1, m, fac=factor(n^2+1); for(j=1, #fac[, 1], if(fac[j, 2]>=3&&fac[j, 1]<=pmax, q=primepi(fac[j, 1]); if(q<=z&&v[q]==0, v[q]=n)))); t=1; j=0; while(t&&j<z, j++; p=prime(j); if(p%4==1, if(v[j]==0, t=0, print1(v[j], ", "))))}
(PARI) {e=3; forprime(p=2, 300, if(p%4==1, q=p^e; m=q; while(!ispower(m-1, 2, &n), m=m+q); print1(n, ", ")))} \\ Klaus Brockhaus, Oct 09 2008
(Python)
from itertools import islice
from sympy import nextprime, sqrt_mod_iter
def A145296_gen(): # generator of terms
p = 1
while (p:=nextprime(p)):
if p&3==1:
yield min(sqrt_mod_iter(-1, p**3))
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Oct 08 2008
STATUS
approved