login
A105263
Least k such that prime(n)*(k^2) + prime(n)*k + 1 = m^2 = a square.
0
3, 7, 8, 15, 39, 7, 8, 8, 335, 32, 55, 24, 704, 39, 1631, 87, 15, 15, 16, 9235919, 119, 4959, 5247, 56, 39, 80, 40, 746511, 104, 488880, 33695, 92901159, 23, 23, 24, 24, 175, 244184, 23855, 552, 1391, 6215, 157440, 55, 168, 56, 319, 43455, 44295, 847
OFFSET
1,1
COMMENTS
When a(n+1)=a(n) then p(n),p(n+1) are twin primes.
MATHEMATICA
lk[n_]:=Module[{k=1, p=Prime[n]}, While[!IntegerQ[Sqrt[p*k^2+p*k+1]], k++]; k]; Array[lk, 15] (* The program generates the first 15 terms of the sequence. To generate more, increase the Array constant but the program may take a long time to run. *) (* Harvey P. Dale, May 26 2023 *)
PROG
(PARI) forprime(p=2, 400, for(k=1, 10^9, if(issquare(p*k*k+p*k+1), print1(k); print1(", "); break)))
CROSSREFS
Sequence in context: A192120 A031404 A263519 * A242572 A136136 A057548
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 15 2005
EXTENSIONS
Edited by Ralf Stephan, Apr 06 2009
STATUS
approved