login
A214879
Numbers that cannot be written as sum of the squares of two primes.
4
0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76
OFFSET
1,3
COMMENTS
A045698(a(n)) = 0.
LINKS
FORMULA
a(n) ~ n. - Charles R Greathouse IV, Sep 01 2015
PROG
(Haskell)
import Data.List (elemIndices)
a214879 n = a214879_list !! (n-1)
a214879_list = elemIndices 0 a045698_list
-- Reinhard Zumkeller, Jul 29 2012
(PARI) is(n)=forprime(p=2, sqrtint(n), if(isprimepower(n-p^2)==2, return(0))); 1 \\ Charles R Greathouse IV, Sep 01 2015
(Python)
from sympy import primerange
def aupto(limit):
primes = list(primerange(2, int((limit-4)**.5)+2))
nums = [p*p + q*q for i, p in enumerate(primes) for q in primes[i:]]
return sorted(set(range(limit+1)) - set(k for k in nums if k <= limit))
print(aupto(76)) # Michael S. Branicky, Aug 13 2021
CROSSREFS
Cf. A045636 (complement).
Sequence in context: A376268 A121166 A249017 * A187226 A026470 A014133
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 29 2012
STATUS
approved