%I #44 Mar 08 2024 01:02:35
%S 1,6,15,28,49,72,103,138,177,228,275,330,397,464,543,620,707,800,891,
%T 1002,1105,1220,1341,1468,1605,1740,1883,2032,2187,2356,2517,2694,
%U 2869,3058,3249,3444,3645,3856,4075,4294,4519,4748,4987,5230
%N a(n) is the number of points with integer coordinates located between the x-axis and the graph of the function y = n^3 / (n^2 + x^2).
%C 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.
%H Robert Israel, <a href="/A359696/b359696.txt">Table of n, a(n) for n = 1..10000</a>
%H Nicolay Avilov, <a href="/A359696/a359696.jpg">Illustration for terms a(1) - a(6)</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Witch_of_Agnesi">Witch of Agnesi</a>.
%F a(n) = n + 2*Sum_{x > 0} floor(n^3/(n^2 + x^2)). - _Andrew Howroyd_, Mar 07 2023
%F a(n) = n + 2*Sum_{y=1..n-1} floor(sqrt(n^3/y-n^2)). - _Chai Wah Wu_, Mar 27 2023
%e a(1) = 1;
%e a(2) = floor(y(-2)) + floor(y(-1)) + floor(y(0)) + floor(y(1)) + floor(y(2)) = 1 + 1 + 2 + 1 + 1 = 6.
%p f:= proc(n) local y; n + 2 * add(floor(sqrt(n^3/y - n^2)),y=1..n-1); end proc:
%p map(f, [$1..100]); # _Robert Israel_, Mar 07 2024
%o (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
%o (Python)
%o from math import isqrt
%o 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
%K nonn
%O 1,2
%A _Nicolay Avilov_, Mar 07 2023
|