A137093 Numbers k such that k and k^2 use only the digits 2, 4, 5 and 6.
2, 5, 25, 65, 665, 6665, 66665, 666665, 6666665, 25625465, 65226242, 66666665, 666666665, 6666666665, 66666666665, 666666666665, 6666666666665, 66666666666665, 666666666666665, 6666666666666665, 66666666666666665, 666666666666666665, 6666666666666666665
Offset: 1
Examples
25625465^2 = 656664456466225.
Links
- Jonathan Wellons, Tables of Shared Digits [archived].
Crossrefs
Cf. A137110.
Programs
-
Mathematica
fQ[n_] := Block[{d = DigitCount@ n}, Total@ Delete[d, {{2}, {4}, {5}, {6}}] == 0]; Select[Range@ 100000, fQ@ # && fQ[#^2] &] (* Michael De Vlieger, Apr 29 2015 *)
-
Python
from itertools import product A137093_list = [int(''.join(a)) for l in range(1,10) for a in product('2456',repeat = l) if set(str(int(''.join(a))**2)) <= {'2','4','5','6'}] # Chai Wah Wu, Apr 29 2015
-
Python
# uses auptod in A137110 print(auptod(16, only="2456")) # Michael S. Branicky, May 25 2021
Extensions
a(20)-a(23) from Michael S. Branicky, May 25 2021
Comments