OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
5 is a member since 5^3 = 125, and 512 = 8^3.
178^3 = 5639752 has same digits as 196^3 = 7529536, so 178 and 196 are in the sequence
MAPLE
dmax:= 10: # to get all terms of at most dmax digits.
N:= 'N':
S:= {}:
for n from 1 while n^3 < 10^dmax do
w:= sort(convert(n^3, base, 10));
if assigned(N[w]) then
if N[w] = 0 then S:= S union {n}
else
S:= S union {n, N[w]};
N[w] = 0
fi
else N[w]:= n
fi
od:
sort(convert(S, list)); # Robert Israel, Jun 15 2017
MATHEMATICA
id3Q[n_]:=Module[{idn3=Sort[IntegerDigits[n^3]], perms}, perms= FromDigits/@ Permutations[idn3]; Length[Select[perms, Sort[IntegerDigits[#]]==idn3 && IntegerQ[#^(1/3)]&]]>1]; Select[Range[1000], id3Q] (* Harvey P. Dale, Apr 27 2012 *)
PROG
(PARI) do(n)=my(v=List()); for(D=1, n, my(m=Map(), low=sqrtnint(10^(D-1)-1, 3)+1, high=sqrtnint(10^D-1, 3), n3, d); for(n=low, high, d=vecsort(digits(n3=n^3)); if(mapisdefined(m, d), mapput(m, d, 1), mapput(m, d, 0))); for(n=low, high, if(mapget(m, vecsort(digits(n^3))), listput(v, n)))); Set(v) \\ Charles R Greathouse IV, Jun 15 2017
(Python)
from sympy import integer_nthroot
from itertools import count, islice
def inthrt(n, r): return integer_nthroot(n, r)[0]
def A188065_gen(root=3): # generator of terms
for d in count(1): # digits of nth power
seen, repeated = dict(), set()
for i in range(inthrt(10**(d-1), root), inthrt(10**d-1, root)+1):
key = "".join(sorted(str(i**root)))
if key in seen: repeated.update([seen[key], i])
else: seen[key] = i
yield from sorted(repeated)
print(list(islice(A188065_gen(), 77))) # Michael S. Branicky, May 27 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Claudio Meller, Mar 20 2011
STATUS
approved