9814072356 is an interesting number: it's the largest square number (99066²) with no repeated digits.
From https://oeis.org/A392242, just added to the #OEIS.
9814072356 is an interesting number: it's the largest square number (99066²) with no repeated digits.
From https://oeis.org/A392242, just added to the #OEIS.
@christianp This led me on a fun journey:
What is the largest cube, fourth power, etc, with no repeated digits? (1 and 2048 are the only 11th powers with no repeated digits)
What is the largest power of 2, 3, 4, etc, with no repeated digits? (536870912 = 2^29)
This led me to the meta question “What is the largest n such that at least one value of n^a (a > 1) has no repeated digits?” which brought me back to 99066 (of course)
@christianp Can’t stop now!
None of 1^1, 2^2, 3^3, 4^4, 5^5 have repeated digits, but all other values of n^n have repeated digits.
1! through 6! have no repeated digits, but all other factorials have repeated digits (could have solved this one by hand but I didn’t)
@christianp
(* Mma: Largest Square With No Repeated Digits in base b *)
In[1]:= LSqWNRD[b_] := Do[ If[ DuplicateFreeQ[ IntegerDigits[r^2,b]], Return[r^2]], {r, Floor[Sqrt[FromDigits[Range[b-1,0,-1],b]]], 0, -1}]
In[2]:= Table[LSqWNRD[b],{b,2,16}]
Out[2]= {1, 1, 225, 576, 38025, 751689, 10323369, 355624164, 9814072356, 279740499025, 8706730814089, 23132511879129, 11027486960232964, 435408094460869201, 18362780530794065025}
This code starts at the base-b equivalent of \( \lfloor\sqrt{9876543210}\rfloor \) and just decreases by 1 at a time. That can be really slow — base 17 has been running for 15 minutes.
I guess a cleverer version of the search would read the digits left-to-right, note the first digit that is a duplicate, and decrement all at once to the point where that digit changes. But I'm too tired to be that clever right now.