A069004 Number of times n^2 + s^2 is prime for positive integers s < n.
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
Examples
a(5)=2 because there are 2 values of s (2 and 4) such that 5^2 + s^2 is a prime number.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
maxN=100; lst={}; For[n=1, n<=maxN, n++, cnt=0; For[d=1, d
?PrimeQ],{n,100}] (* _Harvey P. Dale, Mar 01 2023 *) -
PARI
a(n) = sum(s=1, n-1, isprime(n^2+s^2)); \\ Michel Marcus, Jan 15 2017
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
Extensions
Entries checked by Franklin T. Adams-Watters, May 05 2006
Comments