login
A032923
Numbers whose set of base-16 digits is {1,3}.
1
1, 3, 17, 19, 49, 51, 273, 275, 305, 307, 785, 787, 817, 819, 4369, 4371, 4401, 4403, 4881, 4883, 4913, 4915, 12561, 12563, 12593, 12595, 13073, 13075, 13105, 13107, 69905, 69907, 69937, 69939, 70417, 70419, 70449, 70451
OFFSET
1,2
LINKS
MATHEMATICA
Flatten[Table[FromDigits[#, 16]&/@Tuples[{1, 3}, n], {n, 5}]] (* Vincenzo Librandi, Jun 03 2012 *)
PROG
(Magma) [n: n in [1..75000] | Set(IntegerToSequence(n, 16)) subset {1, 3}]; // Vincenzo Librandi, Jun 03 2012
(Python)
def A032923(n): return (int(bin(m:=n+1)[3:], 16)<<1) + ((1<<(m.bit_length()-1<<2))-1)//15 # Chai Wah Wu, Oct 13 2023
CROSSREFS
Sequence in context: A226925 A259772 A082387 * A018750 A177208 A370106
KEYWORD
nonn,base
STATUS
approved