OFFSET
1,3
COMMENTS
There are 24 numbers in all, not including single-digit numbers, that produce their anagram when converted in hexadecimal.
The decimal and hexadecimal representations must have the same digits in the same proportions. For this reason a number like 1040 is not in the sequence: it is 410 in hexadecimal and thus lacks the second zero. - Alonso del Arte, Mar 04 2013
EXAMPLE
53 = 35_16; 371 = 173_16; 913 = 391_16; 4100 = 1004_16.
MATHEMATICA
Select[Range[0, 10000], Sort[IntegerDigits[#, 10]] == Sort[IntegerDigits[#, 16]] &] (* Alonso del Arte, Mar 04 2013 *)
PROG
(C++) #include <stdio.h> #include <string.h> char area1[8], area2[8]; long unsigned l; char c1[16], c2[16]; void main() { unsigned register a, b; for (l = 10; l < 100000lu; ++l) { sprintf(area1, "%lu", l); sprintf(area2, "%lx", l); if (strlen(area1) != strlen(area2)) continue; memset(c1, 0, 16); memset(c2, 0, 16); for (a = 0; b = area1[a]; ++a) ++c1[b&0xf]; for (a = 0; b = area2[a]; ++a) { if (b >= 'A') b -= 7; ++c2[b&0xf]; } for (a = 0;; ) { if (c1[a] != c2[a]) break; if (++a >= 16) printf("%s=%s(hex) ", area1, area2); } } }
CROSSREFS
KEYWORD
base,easy,fini,nonn,full
AUTHOR
Daniel Mondot, Dec 20 2007
STATUS
approved