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.

A214879 Numbers that cannot be written as sum of the squares of two primes.

This page as a plain text file.
%I A214879 #16 Aug 13 2021 08:05:50
%S A214879 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,
%T A214879 30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,54,55,
%U A214879 56,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,75,76
%N A214879 Numbers that cannot be written as sum of the squares of two primes.
%C A214879 A045698(a(n)) = 0.
%H A214879 Reinhard Zumkeller, <a href="/A214879/b214879.txt">Table of n, a(n) for n = 1..10000</a>
%F A214879 a(n) ~ n. - _Charles R Greathouse IV_, Sep 01 2015
%o A214879 (Haskell)
%o A214879 import Data.List (elemIndices)
%o A214879 a214879 n = a214879_list !! (n-1)
%o A214879 a214879_list = elemIndices 0 a045698_list
%o A214879 -- _Reinhard Zumkeller_, Jul 29 2012
%o A214879 (PARI) is(n)=forprime(p=2,sqrtint(n), if(isprimepower(n-p^2)==2, return(0))); 1 \\ _Charles R Greathouse IV_, Sep 01 2015
%o A214879 (Python)
%o A214879 from sympy import primerange
%o A214879 def aupto(limit):
%o A214879     primes = list(primerange(2, int((limit-4)**.5)+2))
%o A214879     nums = [p*p + q*q for i, p in enumerate(primes) for q in primes[i:]]
%o A214879     return sorted(set(range(limit+1)) - set(k for k in nums if k <= limit))
%o A214879 print(aupto(76)) # _Michael S. Branicky_, Aug 13 2021
%Y A214879 Cf. A045636 (complement).
%K A214879 nonn
%O A214879 1,3
%A A214879 _Reinhard Zumkeller_, Jul 29 2012