login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A346528
Distance between first appearance and last appearance of n in A105224, counting both end points.
1
17, 33, 60, 67, 102, 103, 144, 162, 186, 204, 187, 246, 264, 288, 306, 273, 348, 307, 390, 408, 432, 450, 393, 492, 510, 534, 552, 477, 594, 513, 636, 654, 678, 696, 597, 738, 756, 780, 798, 683, 840, 858, 882, 900
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
FORMULA
a(n) = A346527(n) - A346522(n) + 1.
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
STATUS
approved