OFFSET
1,2
COMMENTS
The graph of the function y = n^3/(n^2+x^2) is called the "Witch of Agnesi". All points with integer coordinates that lie on or below the graph of this function on the interval (-oo; +oo) are considered. Points lying on the x-axis are not taken into account.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Nicolay Avilov, Illustration for terms a(1) - a(6).
Wikipedia, Witch of Agnesi.
FORMULA
a(n) = n + 2*Sum_{x > 0} floor(n^3/(n^2 + x^2)). - Andrew Howroyd, Mar 07 2023
a(n) = n + 2*Sum_{y=1..n-1} floor(sqrt(n^3/y-n^2)). - Chai Wah Wu, Mar 27 2023
EXAMPLE
a(1) = 1;
a(2) = floor(y(-2)) + floor(y(-1)) + floor(y(0)) + floor(y(1)) + floor(y(2)) = 1 + 1 + 2 + 1 + 1 = 6.
MAPLE
f:= proc(n) local y; n + 2 * add(floor(sqrt(n^3/y - n^2)), y=1..n-1); end proc:
map(f, [$1..100]); # Robert Israel, Mar 07 2024
PROG
(PARI) a(n) = {my(t=n, s=0, x=0); while(t > 0, s+=t; x++; t = 2*(n^3\(n^2 + x^2))); s} \\ Andrew Howroyd, Mar 07 2023
(Python)
from math import isqrt
def A359696(n): return (sum(isqrt(n**2*(n-y)//y) for y in range(1, n))<<1)+n # Chai Wah Wu, Mar 27 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Nicolay Avilov, Mar 07 2023
STATUS
approved