cp's OEIS Frontend

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.

A109306 Numbers k such that k^2 + (k-1)^2 and k^2 + (k+1)^2 are both primes.

This page as a plain text file.
%I A109306 #23 Apr 26 2021 01:49:49
%S A109306 2,5,25,30,35,70,85,100,110,225,230,260,285,290,320,390,410,475,490,
%T A109306 495,515,590,680,695,710,750,760,845,950,1080,1100,1135,1175,1190,
%U A109306 1195,1270,1295,1305,1330,1365,1410,1475,1715,1750,1785,1845,1855,1925,2015,2060
%N A109306 Numbers k such that k^2 + (k-1)^2 and k^2 + (k+1)^2 are both primes.
%C A109306 All terms, except for the first one, are multiples of 5. All corresponding primes, except the first, end in 1. Cf. A027861, where in pairs of successive numbers the larger one is a multiple of 5 and is a term in this sequence.
%H A109306 Daniel Starodubtsev, <a href="/A109306/b109306.txt">Table of n, a(n) for n = 1..10000</a>
%F A109306 a(n)^2 = A075577(n). - _David A. Corneth_, Apr 25 2021
%e A109306 25 is a term because 25^2 + 24^2 = 1201 and 25^2 + 26^2 = 1301 are both primes.
%t A109306 Select[Range[2, 10000], PrimeQ[ #^2+(#+1)^2]&&PrimeQ[ #^2+(#-1)^2]&]
%o A109306 (PARI) for(k=1,2060,my(j=2*k^2+1);if(isprime(j-2*k)&&isprime(j+2*k),print1(k,", "))) \\ _Hugo Pfoertner_, Dec 07 2019
%o A109306 (Python)
%o A109306 from sympy import isprime
%o A109306 def aupto(limit):
%o A109306   alst, is2 = [], False
%o A109306   for k in range(1, limit+1):
%o A109306     is1, is2 = is2, isprime(k**2 + (k+1)**2)
%o A109306     if is1 and is2: alst.append(k)
%o A109306   return alst
%o A109306 print(aupto(2060)) # _Michael S. Branicky_, Apr 25 2021
%Y A109306 Cf. A027861, A075577.
%K A109306 nonn
%O A109306 1,1
%A A109306 _Zak Seidov_, Jun 25 2005
%E A109306 Definition corrected by _Walter Kehowski_, Jul 04 2005