This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A289829 #32 Jan 19 2025 11:45:59 %S A289829 25,49,121,169,289,361,841,961,1681,1849,2401,2809,3721,5929,6889, %T A289829 7921,8281,10201,11449,11881,14161,14641,17689,24649,26569,32041, %U A289829 38809,41209,43681,44521,61009,63001,69169,76729,80089,85849,89401,94249,96721,97969,108241 %N A289829 Perfect squares of the form prime(k+1)^2 - prime(k)^2 + 1 where prime(k) is the k-th prime number. %H A289829 Chai Wah Wu, <a href="/A289829/b289829.txt">Table of n, a(n) for n = 1..10000</a> %e A289829 7^2 - 5^2 + 1 = 5^2, 17^2 - 13^2 + 1 = 11^2, 47^2 - 43^2 + 1 = 19^2, etc. %t A289829 TakeWhile[#, # < 110000 &] &@ Union@ Select[Array[Prime[# + 1]^2 - Prime[#]^2 + 1 &, 10^4], IntegerQ@ Sqrt@ # &] (* _Michael De Vlieger_, Jul 13 2017 *) %t A289829 Take[Select[#[[2]]-#[[1]]+1&/@Partition[Prime[Range[3000]]^2,2,1],IntegerQ[Sqrt[#]]&]//Union,50] (* _Harvey P. Dale_, Jan 19 2025 *) %o A289829 (Python) %o A289829 from __future__ import division %o A289829 from sympy import divisors, isprime, prevprime, nextprime %o A289829 A289829_list = [] %o A289829 for n in range(10**4): %o A289829 m = n**2-1 %o A289829 for d in divisors(m): %o A289829 if d*d >= m: %o A289829 break %o A289829 r = m//d %o A289829 if not r % 2: %o A289829 r = r//2 %o A289829 if not isprime(r): %o A289829 p, q = prevprime(r), nextprime(r) %o A289829 if m == (q-p)*(q+p): %o A289829 A289829_list.append(n**2) %o A289829 break # _Chai Wah Wu_, Jul 15 2017 %o A289829 (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 %K A289829 nonn %O A289829 1,1 %A A289829 _Joseph Wheat_, Jul 12 2017 %E A289829 More terms from _Alois P. Heinz_, Jul 13 2017