|
|
A045879
|
|
Numbers whose square contains the same digits as some other square.
|
|
2
|
|
|
12, 13, 14, 16, 21, 25, 31, 32, 33, 36, 37, 42, 44, 49, 54, 64, 69, 96, 98, 99, 101, 102, 103, 106, 108, 110, 112, 113, 120, 122, 128, 129, 130, 133, 135, 137, 140, 144, 146, 148, 152, 153, 154, 155, 157, 158, 159, 160, 166, 172, 174, 178, 179, 181, 186, 190
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
12^2 = 144 has same digits as 21^2 = 441, so 12 and 21 are in the sequence.
|
|
PROG
|
(PARI) uptoqdigits(n) = { res = List(); for(i = 3, n, withqdigits(i); ); Set(res); }
withqdigits(n) = { my(l = List(), streak); for(i = sqrtint(10^(n-1)), sqrtint(10^n-1), listput(l, [vecsort(digits(i^2)), i])); listsort(l); print(#l); for(i = 1, #l-1, if(l[i][1] == l[i+1][1], listput(res, l[i][2]); streak = 1; , if(streak == 1, listput(res, l[i][2])); streak = 0)); if(streak == 1, listput(res, l[#l][2])); } \\ David A. Corneth, Aug 13 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|