OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn,base
AUTHOR
STATUS
approved