OFFSET
1,1
COMMENTS
Squares that have some nontrivial permutation of digits which are also squares.
There are 87 10-digit squares whose digits are a permutation of the digits 0..9. - T. D. Noe, Jan 23 2008
LINKS
Gauray Kumar, Table of n, a(n) for n = 1..10000 (terms 1..1611 from T. D. Noe)
Gauray Kumar, Terms up to 10^9
EXAMPLE
144 is a square and so is 441, which is formed by rearranging the digits of 144.
MATHEMATICA
sndQ[n_]:=Module[{p=Select[FromDigits/@Permutations[IntegerDigits[n]], IntegerLength[ #] == IntegerLength[n]&]}, Length[Select[ p, IntegerQ[ Sqrt[#]]&]]>1]; Select[Range[150]^2, sndQ] (* Harvey P. Dale, Feb 18 2015 *)
PROG
(Perl)
#!/usr/bin/perl
# change this to compute more terms:
$max_digits = 5;
# put the squares into a hash table; for example
# 46 -> 64
# 144 -> 144 441
# 169 -> 169 196 961
$max_i = sqrt(10 ** $max_digits);
for $i (1..$max_i)
{
$i_sq = $i * $i;
$normalized = join('', sort(split(//, "$i_sq")));
$sq_hash{"$normalized"} .= "$i_sq ";
}
# find the hash entries with more than one square
foreach (values(%sq_hash)) { $nums .= $_ if (/ \d/); }
# print the numbers in order
print join(' ', sort( { $a <=> $b } split(' ', "$nums")));
# Jonathan Cross (jcross(AT)juggler.net), Oct 18 2003
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
B-file shortened by N. J. A. Sloane, Dec 08 2018
STATUS
approved