OFFSET
1,2
COMMENTS
a(2n) <= 10^(2n) + 44. Proof. Consider the number m = 12*10^(n - 1). There are a total of 2*n permutations of m that have the same number of digits as m, where each of them satisfies that its square is composed of (2n + 1) digits, which are: 1, 4, 4, and (2n - 2)'s zeros. In this way, we have generated 2*n perfect squares that share all their digits.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
n| k | [permutations of k that are perfect squares]
1| 1 | [1]
2| 144 | [144, 441]
3| 169 | [169, 196, 961]
4| 10044 | [10404, 14400, 40401, 44100]
5| 13468 | [16384, 31684, 36481, 38416, 43681]
6| 10069 | [10609, 16900, 19600, 61009, 90601, 96100]
7| 1003468 | [1638400, 3168400, 3648100, 3806401, 3841600, 4036081, 4368100]
8| 1000069 | [1006009, 1060900, 1690000, 1960000, 6100900, 9006001, 9060100, 9610000]
PROG
(PARI) upto(n) = {my(d=digits(n), qd=#d, maxn=10^qd-1, maxi=sqrtint(maxn), m=Map(), res=[] ); for(i=1, maxi, c=i^2; s=A328447(c); if(mapisdefined(m, s), q=mapget(m, s); mapput(m, s, q+1); , mapput(m, s, 1))); foreach(m, item, if(item[1][2]>#res, res=concat(res, vector(item[1][2]-#res, i, oo)); ); res[item[1][2]]=min(res[item[1][2]], item[1][1]); ); res}
A328447(n)={if(n=vecsort(digits(n)), n[1]|| for(k=2, #n, n[k]&&[n[1]=n[k], n[k]=0, break])); fromdigits(n)} \\ (A328447 from M. F. Hasler, Oct 15 2019)
\\ David A. Corneth, Dec 09 2025
(Python)
from math import isqrt
from collections import Counter
from itertools import count, islice
def b(s): # A328447 for string input
t = "".join(sorted(s)).strip("0")
return int(t[0]+"0"*s.count("0")+t[1:])
def agen():
adict, n, pcdict, digs = dict(), 1, Counter(), -1
for d in count(1):
pcdict = Counter()
for m in range(isqrt(10**(d-1)-1)+1, isqrt(10**d-1)+1):
pcdict[b(str(m*m))] += 1
if pcdict:
vals = set(pcdict.values())
for i in range(n, max(vals)+1):
if i in vals:
adict[i] = next(k for k in sorted(pcdict) if pcdict[k] == i)
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 30))) # Michael S. Branicky, Dec 09 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gonzalo MartÃnez, Dec 08 2025
EXTENSIONS
a(7), a(9), a(14)-a(18), a(23), a(26) corrected by Michael S. Branicky, Dec 08 2025
STATUS
approved
