login
A391189
a(n) = least integer m such that concatenating n distinct nonzero squares <= m^2 in ascending order yields a perfect square.
0
1, 3, 6, 10, 14, 29, 29, 70
OFFSET
1,2
COMMENTS
a(n) <= square root of the largest of the n squares that was used to construct A391022(n).
EXAMPLE
Case n=2: Squares <= 3^2 = 9 are 1,4,9.
Concatenating 4 and 9 gives 49, which is 7^2. Thus a(2) = 3.
PROG
(Python)
from math import isqrt
from itertools import combinations, count
def is_square(n): return isqrt(n)**2 == n
def a(n):
squares = [str(i*i) for i in range(1, n)]
for m in count(n):
mm = str(m**2)
for c in combinations(squares, n-1):
if is_square(s:=int("".join(c)+mm)):
return m # use s to obtain the concatenation of squares
squares.append(mm)
print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Dec 03 2025
CROSSREFS
Sequence in context: A049989 A330258 A197056 * A379675 A104619 A194037
KEYWORD
nonn,base,more
AUTHOR
Jean-Marc Rebert, Dec 02 2025
STATUS
approved