OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
7^2 - 5^2 + 1 = 5^2, 17^2 - 13^2 + 1 = 11^2, 47^2 - 43^2 + 1 = 19^2, etc.
MATHEMATICA
TakeWhile[#, # < 110000 &] &@ Union@ Select[Array[Prime[# + 1]^2 - Prime[#]^2 + 1 &, 10^4], IntegerQ@ Sqrt@ # &] (* Michael De Vlieger, Jul 13 2017 *)
PROG
(Python)
from __future__ import division
from sympy import divisors, isprime, prevprime, nextprime
A289829_list = []
for n in range(10**4):
m = n**2-1
for d in divisors(m):
if d*d >= m:
break
r = m//d
if not r % 2:
r = r//2
if not isprime(r):
p, q = prevprime(r), nextprime(r)
if m == (q-p)*(q+p):
A289829_list.append(n**2)
break # Chai Wah Wu, Jul 15 2017
(PARI) is(n) = if(!issquare(n), return(0), my(p=2); while(1, if(n==nextprime(p+1)^2-p^2+1, return(1)); p=nextprime(p+1); if(p > n, return(0)))) \\ Felix Fröhlich, Jul 15 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph Wheat, Jul 12 2017
EXTENSIONS
More terms from Alois P. Heinz, Jul 13 2017
STATUS
approved