OFFSET
1,1
COMMENTS
In the plane, consider the parabola y=x^2. There are n squares "strung" on the y axis so that two vertices of each square lie on the axis of the parabola, and the other two belong to the parabola. In this case, the sizes of the squares are chosen so that the lower vertices of the squares have ordinates 0, 1, 2, 3, ..., n - 1. See link.
LINKS
Nicolay Avilov, Illustration of initial terms
Nicolay Avilov, Problem 2481. Squares in a parabola (in Russian).
FORMULA
a(n) = 2*(Sum_{k=1..n} floor(sqrt(4*k-3))) + 2 - floor((sqrt(4*n-3)-1)/2). - Oleg Sorokin, Apr 22 2023
EXAMPLE
a(1) = 1 + 3 = 4;
a(2) = 2 + 6 = 8;
a(3) = 4 + 9 = 13.
See link.
PROG
(Python)
from math import isqrt
a, M = 3, []
for N in range(200):
k = 4 * N + 1
G = isqrt(k)
a += 2 * G - (G ** 2 == k)
M.append(a)
print(M) # Oleg Sorokin, Apr 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Nicolay Avilov, Apr 14 2023
STATUS
approved