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.

A304905 Greatest difference d such that both n^2 - d and n^2 + d are primes.

This page as a plain text file.
%I A304905 #6 May 20 2018 18:03:12
%S A304905 1,4,13,22,31,30,45,76,97,118,139,162,193,218,253,282,319,358,397,436,
%T A304905 453,522,553,612,645,724,765,828,889,918,1005,1072,1153,1222,1283,
%U A304905 1362,1413,1516,1587,1678,1753,1842,1917
%N A304905 Greatest difference d such that both n^2 - d and n^2 + d are primes.
%F A304905 a(n) = (A304904(n) - A304903(n))/2 = n^2 - A304903(n) = A304904(n) - n^2.
%e A304905 a(2) = 1 because 2^2 - 1 = 3 and 2^2 + 1 = 5 are primes.
%e A304905 a(7) = 30 because 7^2 - 30 = 19 and 7^2 + 30 = 79 is the pair with maximum difference. All greater differences lead to at least one composite, i.e., 49 + 32 = 81, 49 - 34 = 15, 49 + 36 = 85, 49 + 38 = 87, 49 - 40 = 9, 49 + 42 = 91 = 7*13, 49 + 44 = 93 = 3*31, 49 + 46 = 95, and 49 - 48 = 1 is not a prime.
%o A304905 (PARI) a304903(n) = forprime(p=3, , if(ispseudoprime(2*n^2-p), return(p)))
%o A304905 a(n) = n^2 - a304903(n) \\ _Felix Fröhlich_, May 20 2018
%Y A304905 Cf. A172989, A304903, A304904.
%K A304905 nonn
%O A304905 2,2
%A A304905 _Hugo Pfoertner_, May 20 2018