login
A069004
Number of times n^2 + s^2 is prime for positive integers s < n.
5
0, 1, 1, 1, 2, 2, 1, 3, 1, 4, 2, 1, 4, 3, 3, 3, 4, 3, 4, 6, 2, 4, 5, 3, 7, 6, 4, 4, 4, 4, 7, 6, 5, 6, 8, 5, 6, 7, 3, 9, 5, 5, 8, 8, 7, 9, 6, 7, 10, 8, 6, 9, 10, 5, 8, 8, 6, 10, 11, 8, 11, 10, 6, 9, 15, 5, 10, 11, 4, 11, 13, 6, 12, 10, 12, 11, 9, 8, 11, 19, 10, 15, 9, 8, 19, 11, 8, 11, 14, 15, 13
OFFSET
1,5
COMMENTS
Conjecture: a(n)>0 for all n>1. - Entries checked by Franklin T. Adams-Watters, May 05 2006
The graph of this sequence inspires the following conjecture: A > a(n)/pi(n) > B, where A and B are constants and pi(n) is the prime counting function (A000720). - T. D. Noe, Feb 26 2007
Stronger conjecture: Let pi(n) be the prime counting function (A000720). Then pi(n) >= a(n) >= pi(n)/5 for n>1, with the following equalities: pi(2)=a(2), pi(10)=a(10) and a(12)=pi(12)/5. - T. D. Noe, Feb 26 2007
Records in a(n) are for n = 1, 2, 5, 8, 10, 20, 25, 35, 40, 49, 59, 65, 80, 115, 125, 130, 158, 200, 250, 265, 310, ... - Thomas Ordowski, Mar 05 2017
Number of primes p = (x^2 + y^2)/2 with 0 < x < y such that x + y = 2n. - Thomas Ordowski, Mar 06 2017
4*(2*(Sum_{k=1..n} a(k))+1+floor((n+1)/4)) is the number of Gaussian primes u+v*i such that max(|u|, |v|) <= n (see examples). - Lorenzo Sauras Altuzarra, Jan 12 2026
LINKS
Eric Weisstein's World of Mathematics, Gaussian Prime.
FORMULA
a(n) = O(n/log(n)). a(n) <= phi(n), a(n) = phi(n) for n = 2, 6, and 10. a(n) <= phi(2n)/2, a(n) = phi(2n)/2 for n = 2, 3, 5, 6, and 10. - Thomas Ordowski, Mar 01 2017
EXAMPLE
a(5)=2 because there are 2 values of s (2 and 4) such that 5^2 + s^2 is a prime number.
The 48 Gaussian primes u+v*i such that max(|u|, |v|) <= 5 are: -5-4i, -5-2i, -5+2i, -5+4i, -4-5i, -4-i, -4+i, -4+5i, -3-2i, -3, -3+2i, -2-5i, -2-3i, -2-i, -2+i, -2+3i, -2+5i, -1-4i, -1-2i, -1-i, -1+i, -1+2i, -1+4i, -3i, 3i, 1-4i, 1-2i, 1-i, 1+i, 1+2i, 1+4i, 2-5i, 2-3i, 2-i, 2+i, 2+3i, 2+5i, 3-2i, 3, 3+2i, 4-5i, 4-i, 4+i, 4+5i, 5-4i, 5-2i, 5+2i, 5+4i (see Weisstein's link). And indeed, 4*(2*(Sum_{k=1..5} a(k))+1+floor((5+1)/4)) = 4*(2*(0+1+1+1+2)+1+floor((5+1)/4)) = 48. - Lorenzo Sauras Altuzarra, Jan 12 2026
MATHEMATICA
maxN=100; lst={}; For[n=1, n<=maxN, n++, cnt=0; For[d=1, d<n, d=d+2, p=n^2+(n-d)^2; If[PrimeQ[p], cnt++ ] ]; AppendTo[lst, cnt]; ]; lst
Table[Count[n^2+Range[n-1]^2, _?PrimeQ], {n, 100}] (* Harvey P. Dale, Mar 01 2023 *)
PROG
(PARI) a(n) = sum(s=1, n-1, isprime(n^2+s^2)); \\ Michel Marcus, Jan 15 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
T. D. Noe, Apr 02 2002
EXTENSIONS
Entries checked by Franklin T. Adams-Watters, May 05 2006
STATUS
approved