A137110 Numbers k such that k and k^2 use only the digits 2, 5, 6 and 7.
5, 25, 26, 75, 76, 275, 525, 526, 725, 7525, 27525, 72576, 256266, 276725, 725725, 276726675, 756652275
Offset: 1
Examples
276726675^2 = 76577652656555625.
Links
- David A. Corneth, PARI program
- Jonathan Wellons, Tables of Shared Digits [archived].
Programs
-
PARI
\\ See PARI link. David A. Corneth, May 25 2021
-
Python
def auptod(maxdigits, only="2567"): aset, digset, valid = set(), set(only), set(only) for e in range(1, maxdigits+1): newvalid = set() for tstr in valid: t = int(tstr) if set(str(t**2)) <= digset: aset.add(t) for d in digset: dtstr = d + tstr dt = int(dtstr) remstr = str(dt**2)[-e-1:] if set(remstr) <= digset: newvalid.add(dtstr) valid = newvalid return sorted(aset) print(auptod(16)) # Michael S. Branicky, May 25 2021
Comments