login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A133287 Decimal numbers that when converted to hexadecimal produce a number that uses the same digits as the original number. 1

%I

%S 0,1,2,3,4,5,6,7,8,9,53,371,913,4100,5141,5412,6182,8200,9241,75120,

%T 75121,75122,75123,75124,75125,75126,75127,75128,75129,75621,86150,

%U 91465,98711,99481

%N Decimal numbers that when converted to hexadecimal produce a number that uses the same digits as the original number.

%C There are 24 numbers in all, not including single-digit numbers, that produce their anagram when converted in hexadecimal.

%C 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

%e 53 = 35_16; 371 = 173_16; 913 = 391_16; 4100 = 1004_16.

%t Select[Range[0, 10000], Sort[IntegerDigits[#, 10]] == Sort[IntegerDigits[#, 16]] &] (* _Alonso del Arte_, Mar 04 2013 *)

%o (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); } } }

%K base,easy,fini,nonn,full

%O 1,3

%A _Daniel Mondot_, Dec 20 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 6 09:00 EDT 2020. Contains 333268 sequences. (Running on oeis4.)