[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A188065
Numbers k such that k^3 contains the same digits as some other cube.
4
5, 8, 35, 38, 50, 80, 101, 102, 110, 178, 196, 201, 221, 227, 257, 258, 279, 289, 319, 329, 331, 341, 345, 350, 355, 356, 371, 379, 380, 384, 405, 406, 408, 417, 427, 455, 457, 473, 497, 500, 514, 553, 564, 576, 635, 638, 639, 641, 644, 656, 665, 668, 674, 689, 709, 711, 722, 725, 773, 781, 792, 800, 804, 836, 858, 862, 894, 923, 933, 943, 961, 973, 978, 981, 983, 992, 996
OFFSET
1,1
LINKS
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
Sequence in context: A275003 A032790 A187997 * A204676 A219947 A075273
KEYWORD
nonn,base
AUTHOR
Claudio Meller, Mar 20 2011
STATUS
approved