OFFSET
0,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = Sum_{k=0..n} A000161(k).
a(n) is asymptotic to Pi*n/8.
EXAMPLE
0^2 + 0^2, 0^2 + 1^2, 1^2 + 1^2 are less than or equal to 2 hence a(2) = 3.
MATHEMATICA
Accumulate @ Table[Length @ PowersRepresentations[n, 2, 2], {n, 0, 100}] (* Amiram Eldar, Mar 08 2020 *)
PROG
(PARI) a(n)=sum(x=0, n, sum(y=0, x, if((sign(x^2+y^2-n)+1)*sign(x^2+y^2-n), 0, 1)))
(Python)
from itertools import count, islice
from math import prod
from sympy import factorint
def A073092_gen(): # generator of terms
yield (c:=1)
for n in count(1):
f = factorint(n)
c += int(not any(e&1 for e in f.values())) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1)
yield c
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Aug 18 2002
STATUS
approved