login
A235994
Numbers having at least one anagram which is a cube.
2
1, 8, 27, 46, 64, 72, 125, 126, 152, 162, 215, 216, 251, 261, 279, 297, 334, 343, 433, 512, 521, 612, 621, 729, 792, 927, 972, 1000, 1133, 1269, 1278, 1279, 1287, 1296, 1297, 1313, 1331, 1349, 1394, 1439, 1493, 1629, 1692, 1728, 1729, 1782, 1792, 1827, 1872
OFFSET
1,2
COMMENTS
An anagram of a k-digit number is one of the k! permutations of the digits that does not begin with 0.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
EXAMPLE
126 is in the sequence because 216 = 6^3.
MATHEMATICA
Select[Range[2000], AnyTrue[Surd[FromDigits/@Select[ Permutations[ IntegerDigits[#]], #[[1]]>0&], 3], IntegerQ]&] (* The program uses the AnyTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 15 2016 *)
PROG
(Python)
from itertools import count, takewhile
def hash(n): return "".join(sorted(str(n)))
def aupto_digits(d):
cubes = takewhile(lambda x:x<10**d, (i**3 for i in count(1)))
C = set(map(hash, cubes))
return [k for k in range(1, 10**d) if hash(k) in C]
print(aupto_digits(4)) # Michael S. Branicky, Feb 18 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Jan 19 2014
STATUS
approved