login
A393978
Numbers x such that x^2 = y^2 + r for some y, where r is an anagram of y^2.
6
0, 39, 69, 105, 225, 240, 264, 276, 321, 342, 348, 351, 354, 357, 366, 390, 393, 399, 462, 465, 492, 522, 525, 537, 585, 621, 660, 690, 702, 738, 747, 753, 759, 765, 777, 789, 792, 798, 804, 807, 816, 828, 837, 849, 855, 858, 861, 867, 873, 876, 906, 909, 924, 933, 963, 990, 999, 1005, 1029, 1035
OFFSET
1,2
COMMENTS
An anagram of x is a number whose base-10 representation is a permutation of that of x, where leading zeros are not allowed (except for x = 0).
All terms are divisible by 3.
LINKS
EXAMPLE
a(6) = 240 is a term because 240^2 = 156^2 + 33264, where 33264 is an anagram of 156^2 = 24336.
The first term with more than one such representation is a(7) = 264, where 264^2 = 198^2 + 30492 = 231^2 + 16335, where 30492 is an anagram of 198^2 = 39204 and 16335 is an anagram of 231^2 = 53361.
MAPLE
g:= proc(n) local d, L, i;
L:= convert(n, base, 10); d:= nops(L);
select(issqr, convert(map(t -> n + add(t[i]*10^(i-1), i=1..d), select( t -> t[-1] <> 0, combinat:-permute(L))), set))
end proc:
A:=map(sqrt, select(`<=`, `union`({0}, op(map(g, {seq(i^2, i=1..2000)}))), 4*10^6)):
sort(convert(A, list));
MATHEMATICA
ClearAll[permNumber, g, Q, U, U2, A];
permNumber[n_]:=Module[{d=Reverse[IntegerDigits[n]]}, FromDigits[Reverse[#]]&/@Select[Permutations[d], Last[#]!=0&]];
g[n_]:=Select[n+permNumber[n], IntegerQ[Sqrt[#]]&];
Q=Table[k^2, {k, 1, 2000}];
U=Union[Join[Flatten[g/@Q], {0}]];
U2=Select[U, #<=4*10^6&];
A=Sort[Sqrt/@U2];
A (* Vincenzo Librandi, Mar 12 2026, after Maple. *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Mar 05 2026
STATUS
approved