What is the largest square (not ending in 0) whose digits are in non-increasing order, for example 441 and 7744?
Program checking n up to 10^8 (n^2 up to 10^16) finds:
[1, 4, 9, 64, 81, 441, 841, 961, 7744, 8874441, 9853321, 999887641]
This is oeis A062826, "Square nialpdromes not ending in 0". The listing at oeis indicates that there are no more values checking up to 10^42.
A nialpdrome is a number whose digits are in non-increasing order.
I had not seen the word "nialpdrome" before; this appears to be a jumble of palindrome, where the first 5 letters are not-quite-precisely reversed.
Statistical argument (not a proof) that this set might be finite:
It can be shown that as the number of digits increases by 1:
- the number of integers increases by a factor of 10,
- the number of squares increases by a factor of ~√10
- the number of nialpdromes not ending in zero increases by a factor of (n+8)/n, which approaches 1 for large n.
So statistically, as the number of digits increases by one, the probability that a random n-digit number is a square nialpdrome is
1/√10 times the same probability for an (n-1)digit number
-----------
ndigitsquares = [0]
currentn = 1
count = 0
for n in range(10000):
numdigits = len(str(n**2))
if numdigits == currentn:
count += 1
elif numdigits > currentn:
ndigitsquares.append(count)
count = 1
currentn += 1
print(ndigitsquares)
|
Posted by Larry
on 2024-05-11 09:51:34 |