A064272 Number of representations of n as the sum of a prime number and a nonzero square.
0, 1, 1, 0, 2, 1, 1, 1, 0, 2, 2, 0, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 0, 1, 3, 2, 1, 2, 0, 3, 2, 0, 2, 1, 0, 4, 2, 1, 2, 2, 1, 2, 2, 1, 3, 2, 1, 1, 2, 2, 2, 3, 1, 3, 2, 0, 2, 2, 0, 4, 2, 0, 2, 3, 2, 4, 2, 1, 2, 3, 1, 1, 3, 1, 4, 2, 1, 3, 1, 1, 5, 3, 0, 3, 3, 2, 2, 2, 0, 4, 2, 1, 3, 2, 1, 4, 1, 1, 2, 3, 2, 3, 4, 1
Offset: 2
Keywords
Examples
6=2+4=5+1, thus a(6)=2.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 2..10000
Programs
-
Haskell
a064272 n = sum $ map (a010051 . (n -)) $ takeWhile (< n) $ tail a000290_list -- Reinhard Zumkeller, Jul 23 2013, Sep 30 2011
Formula
G.f.: (Sum_{k>=1} x^prime(k))*(Sum_{k>=1} x^(k^2)). - Ilya Gutkovskiy, Feb 05 2017
Comments