OFFSET
1,1
COMMENTS
4*n*(k + n) is a square. If n is a square, then k + n is also a square.
If n is prime, then n divides k.
a(n) = A339007(n) for n = 1, 2, 3, 4, 6, 7 and 9.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..60
EXAMPLE
a(1) = 24 because 24^2 + 1 = 577, (24 + 2)^2 + 1 = 677. The numbers 577 and 677 are two consecutive primes of the form m^2+1, and 677 - 577 = 10^2 is a square. The other values m such that p = m^2 + 1 and q = (m+2)^2 + 1 are consecutive primes with q - p square are 11024, 133224, 156024, 342224, 416024, ...
a(2) = 6 because 6^2 + 1 = 37, (6 + 4)^2 + 1 = 101. The numbers 37 and 101 are two consecutive primes of the form m^2+1, and 101 - 37 = 8^2 is a square. The other values m such that p = m^2 + 1 and q = (m+4)^2 + 1 are consecutive primes with q - p square are 16, 126, 1350, 1456, 1566, 2310, 5200, ...
MAPLE
for n from 1 to 25 do:
ii:=0:n1:=0:q:=2:
for k from 2 by 2 to 10^9 while(ii=0) do:
p:=k^2+1:
if isprime(p)
then
x:=p-q:q:=p:z:=sqrt(x):
if z=floor(z) and k-n1=2*n
then
ii:=1:printf(`%d %d \n`, n, n1):
else
n1:=k:
fi:
fi:
od:
od:
PROG
(PARI) consecutive(p, q) = {forprime(r = nextprime(p+1), precprime(q-1), if (isprime(r) && issquare(r-1), return(0)); ); return(1); }
a(n) = my(k=1); while (!(isprime(p=k^2+1) && isprime(q=(k+2*n)^2 + 1) && issquare(q-p) && consecutive(p, q)), k++); k; \\ Michel Marcus, Nov 30 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 18 2020
EXTENSIONS
a(26)-a(32) from Chai Wah Wu, Dec 06 2020
STATUS
approved