A258780 a(n) is the least k such that k^2 + 1 is a semiprime p*q, p < q, and (q - p)/2^n is prime.
8, 12, 140, 64, 2236, 196, 1300, 1600, 6256, 5084, 248756, 246196, 484400, 36680, 887884, 821836, 1559116, 104120, 126072244, 9586736, 4156840, 542759984, 1017981724, 2744780140, 405793096, 148647496, 1671024916
Offset: 2
Examples
a(2)=8 because 8^2+1 = 5*13 and (13-5)/2^2 = 2 is prime. The number 8 is the first term of the sequence 8, 22, 34, 46, 50, 58, ... a(3)=12 because 12^2+1 = 5*29 and (29-5)/2^3 = 3 is prime. The number 12 is the first term of the sequence 12, 28, 44, 52, 76, 80, ... a(4)=140 because 140^2+1 = 17*1153 and (1153-17)/2^4 = 71 is prime. The number 140 is the first term of the sequence 140, 296, 404, 604, ...
Programs
-
Mathematica
lst={};Do[k=2;While[!(Plus@@Last/@FactorInteger[k^2+1]==2&&PrimeQ[(FactorInteger[k^2+1][[-1,1]]-FactorInteger[k^2+1][[1,1]])/2^n]),k=k+2];Print[n," ",k],{n,2,19}];lst
-
PARI
isok(k, n) = my(kk=k^2+1, f=factor(kk)[,1]~); (bigomega(kk) == 2) && (#f == 2) && (p=f[1]) && (q=f[2]) && (qq=(q-p)/2^n) && !frac(qq) && isprime(qq); a(n) = my(k=2); while (!isok(k,n), k+=2); k; \\ Michel Marcus, Apr 13 2019
Extensions
Name edited by Jon E. Schoenfield, Sep 12 2017
a(20)-a(22) from Daniel Suteu, Apr 13 2019
a(23)-a(28) from Daniel Suteu, Nov 09 2019
Comments