login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A032936
Numbers whose set of base-16 digits is {1,2}.
1
1, 2, 17, 18, 33, 34, 273, 274, 289, 290, 529, 530, 545, 546, 4369, 4370, 4385, 4386, 4625, 4626, 4641, 4642, 8465, 8466, 8481, 8482, 8721, 8722, 8737, 8738, 69905, 69906, 69921, 69922, 70161, 70162, 70177, 70178, 74001, 74002
OFFSET
1,2
LINKS
MATHEMATICA
Flatten[Table[FromDigits[#, 16]&/@Tuples[{1, 2}, n], {n, 5}]] (* Vincenzo Librandi, Jun 04 2012 *)
PROG
(Magma) [n: n in [1..75000] | Set(IntegerToSequence(n, 16)) subset {1, 2}]; // Vincenzo Librandi, Jun 04 2012
(Python)
def a(n): return int(bin(n+1)[3:].replace('1', '2').replace('0', '1'), 16)
print([a(n) for n in range(1, 41)]) # Michael S. Branicky, Aug 22 2021
CROSSREFS
Sequence in context: A198596 A198408 A198534 * A263329 A342470 A368856
KEYWORD
nonn,base
STATUS
approved