OFFSET
1,1
COMMENTS
When the sequence A105224 is plotted, we get horizontal lines which lie roughly on a parabola and correspond to repeated values in the sequence. This sequence is the length of these lines.
Empirically, all elements seem to roughly lie on either of the lines 20.5*n or 17*n.
LINKS
Elvar Wang Atlason, Table of n, a(n) for n = 1..5000
EXAMPLE
For n = 1, the number 1 appears in the sequence A105224 at indices ranging from 1 to 17. This is because the intervals [1,2] and [17,34] each contain 1 square, and are the smallest and largest intervals, respectively, of the form [k,2*k] that contain exactly 1 square. So a(1) = 17.
PROG
(Python)
k = 1
n = 1
while n<100:
if math.isqrt(2*k)-math.isqrt(k-1) == n:
k1 = k
t = k
k2 = k
while t < 6*(n+1)**2:
if math.isqrt(2*t)-math.isqrt(t-1) == n:
k2 = t
t = t+1
n = n+1
print(k2-k1+1)
k = k+1
(Python)
from math import isqrt
def A346528(n):
if n == 1: return 17
a, b, k, k2, m, r, s = -6*(n+1)**2, (n+1)**4, 2, 4, 1, 0, 0
while 2*m+a < 0 or m*(m+a)+b < 0:
if isqrt(2*m) - isqrt(m-1) == n:
r = m
if s == 0 and isqrt(2*m+2)-isqrt(m) == n:
s = m
k += 1
k2 += 2*k-1
m = (k2-1)//2
return r-s # Chai Wah Wu, Sep 28 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Hrólfur Eyjólfsson, Elvar Wang Atlason, Jul 22 2021
STATUS
approved