OFFSET
0,2
COMMENTS
a(32)/32 = 100/32 = 3.125; lim_{n->infinity} a(n)/n = Pi.
The terms of this sequence are four times the running total of the excess of the 4k + 1 divisors of the natural numbers (from 1 through to n) over their 4k + 3 divisors. - Ant King, Mar 12 2013
REFERENCES
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 339
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Sum of Squares Function
EXAMPLE
For n=2 the 8 solutions are (x,y) = (+-1,0), (0,+-1), (+-1,+-1).
MAPLE
MATHEMATICA
Prepend[SquaresR[2, #] &/@Range[59], 0]//Accumulate (* Ant King, Mar 12 2013 *)
PROG
(PARI) a(n)=local(j); j=sqrtint(n); sum(x=-j, j, sum(y=-j, j, x^2+y^2<=n))-1
(Python)
from math import prod
from itertools import count, accumulate, islice
from sympy import factorint
def A014198_gen(): # generator of terms
return accumulate(map(lambda n:prod(e+1 if p & 3 == 1 else (e+1) & 1 for p, e in factorint(n).items() if p > 2) << 2, count(1)), initial=0)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved