login
A032922
Numbers whose set of base-15 digits is {1,3}.
1
1, 3, 16, 18, 46, 48, 241, 243, 271, 273, 691, 693, 721, 723, 3616, 3618, 3646, 3648, 4066, 4068, 4096, 4098, 10366, 10368, 10396, 10398, 10816, 10818, 10846, 10848, 54241, 54243, 54271, 54273, 54691, 54693, 54721, 54723
OFFSET
1,2
LINKS
MATHEMATICA
Flatten[Table[FromDigits[#, 15]&/@Tuples[{1, 3}, n], {n, 5}]] (* Vincenzo Librandi, Jun 03 2012 *)
PROG
(Magma) [n: n in [1..55000] | Set(IntegerToSequence(n, 15)) subset {1, 3}]; // Vincenzo Librandi, Jun 03 2012
(Python)
def A032922(n): return (int(bin(m:=n+1)[3:], 15)<<1) + (15**(m.bit_length()-1)-1)//14 # Chai Wah Wu, Oct 13 2023
CROSSREFS
Sequence in context: A370978 A068516 A219508 * A103655 A022126 A127006
KEYWORD
nonn,base
STATUS
approved