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”).

Squares which can be rearranged into squares with the same number of digits.
4

%I #32 Dec 08 2018 13:54:10

%S 144,169,196,256,441,625,961,1024,1089,1296,1369,1764,1936,2401,2916,

%T 4096,4761,9216,9604,9801,10201,10404,10609,11236,11664,12100,12544,

%U 12769,14400,14884,16384,16641,16900,17689,18225,18769,19600,20736

%N Squares which can be rearranged into squares with the same number of digits.

%C Squares that have some nontrivial permutation of digits which are also squares.

%C There are 87 10-digit squares whose digits are a permutation of the digits 0..9. - _T. D. Noe_, Jan 23 2008

%H Gauray Kumar, <a href="/A034289/b034289.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1611 from T. D. Noe)

%H Gauray Kumar, <a href="/A034289/a034289.txt">Terms up to 10^9</a>

%e 144 is a square and so is 441, which is formed by rearranging the digits of 144.

%t 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 *)

%o (Perl)

%o #!/usr/bin/perl

%o # change this to compute more terms:

%o $max_digits = 5;

%o # put the squares into a hash table; for example

%o # 46 -> 64

%o # 144 -> 144 441

%o # 169 -> 169 196 961

%o $max_i = sqrt(10 ** $max_digits);

%o for $i (1..$max_i)

%o {

%o $i_sq = $i * $i;

%o $normalized = join('', sort(split(//, "$i_sq")));

%o $sq_hash{"$normalized"} .= "$i_sq ";

%o }

%o # find the hash entries with more than one square

%o foreach (values(%sq_hash)) { $nums .= $_ if (/ \d/); }

%o # print the numbers in order

%o print join(' ', sort( { $a <=> $b } split(' ',"$nums")));

%o # Jonathan Cross (jcross(AT)juggler.net), Oct 18 2003

%K nonn,base

%O 1,1

%A _Erich Friedman_

%E B-file shortened by _N. J. A. Sloane_, Dec 08 2018