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.

A045698 Number of ways n can be written as the sum of two squares of primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
Offset: 0

Views

Author

Keywords

Comments

a(A214879(n)) = 0; a(A045636(n)) > 0; a(A214723(n)) = 1; a(A214511(n)) = n and a(m) < n for m < A214511(n). - Reinhard Zumkeller, Jul 29 2012
The smallest value of n such that a(n) = 2 is 338. (This helps distinguish it from the characteristic function of A045636.) - Wesley Ivan Hurt, Jun 13 2013

Examples

			For example, a(29) = 1 because 29 = 2^2 + 5^2. a(3) = 0 because there is no way to write 3 as sum of two squares of primes.
		

Crossrefs

Programs

  • Haskell
    a045698 n = length $ filter (\x -> x > 0 && a010051' x == 1) $
    map (a037213 . (n -)) $
    takeWhile (<= div n 2) a001248_list
    -- Reinhard Zumkeller, Jul 29 2012
    
  • PARI
    a(n)=my(s=0,q);forprime(p=2,sqrtint(n\2),if(issquare(n-p^2,&q)&&isprime(q),s++));s \\ Charles R Greathouse IV, Jun 04 2014

Extensions

More terms from Erich Friedman