OFFSET
1,2
COMMENTS
If k is present then so is 1000k.
Cube root of n's: 1, 4, 9, 10, 13, 16, 21, 25, 27, 28, 36, 40, 45, 48, 49, 51, 54, 60, 61, 64, ..., .
Leading zeros in squares are allowed, i.e. an anagram of 1000 is 0001. - Chai Wah Wu, Nov 04 2016
LINKS
Robert G. Wilson v and Chai Wah Wu, Table of n, a(n) for n = 1..10000 a(n) for n = 1..872 from Robert G. Wilson v.
EXAMPLE
2197 is a term because it is a cube (13^3) and 7921 (an anagram of 2197) is a square (89 * 89).
MATHEMATICA
fQ[n_] := Union[ IntegerQ@ Sqrt@ FromDigits@ # & /@ Permutations@ IntegerDigits@ n][[-1]] == True; lst = {}; Do[ If[ fQ[n^3], AppendTo[lst, n^3]; Print[n^3]], {n, 1650}] (* Or for larger n's *)
(* first do *) Needs[ "Combinatorica`" ] (* then *) fQ[ n_ ] := Block[ {id = IntegerDigits@n, k = 1, mx = Floor[ Log[ 10, n ] +1 ]! +1}, While[ k < mx && !IntegerQ@ Sqrt@ FromDigits@ UnrankPermutation[ k, id ], k++ ]; If[ k != mx, True, False ] ]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Claudio Meller, Jun 20 2009
EXTENSIONS
Edited, corrected, extended by Robert G. Wilson v, Jun 30 2009
STATUS
approved