OFFSET
1,3
COMMENTS
The subsequence of primes in this sequence begins 3, 7, 29, 103, 269, 619, 1811, 3271.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{i=1..n} A001481(i) = Sum_{i=1..n} (numbers that are the sum of 2 nonnegative squares) = Sum_{i=1..n} (numbers n such that i = x^2 + y^2 has a solution in nonnegative integers x, y).
EXAMPLE
a(66) = 0 + 1 + 2 + 4 + 5 + 8 + 9 + 10 + 13 + 16 + 17 + 18 + 20 + 25 + 26 + 29 + 32 + 34 + 36 + 37 + 40 + 41 + 45 + 49 + 50 + 52 + 53 + 58 + 61 + 64 + 65 + 68 + 72 + 73 + 74 + 80 + 81 + 82 + 85 + 89 + 90 + 97 + 98 + 100 + 101 + 104 + 106 + 109 + 113 + 116 + 117 + 121 + 122 + 125 + 128 + 130 + 136 + 137 + 144 + 145 + 146 + 148 + 149 + 153 + 157 + 160 = 4876.
MAPLE
N:= 1000:
A001481:= sort(convert({seq(seq(x^2+y^2, y=0..floor(sqrt(N-x^2))), x=0..floor(sqrt(N)))}, list)):
ListTools:-PartialSums(A001481); # Robert Israel, Mar 15 2016
PROG
(Python)
from itertools import count, accumulate, islice
from sympy import factorint
def A173256_gen(): # generator of terms
return accumulate(filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items()), count(0)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonathan Vos Post, Feb 14 2010
EXTENSIONS
a(21) corrected by Robert Israel, Mar 15 2016
STATUS
approved