A074938 Odd numbers such that base 3 representation contains no 2.
1, 3, 9, 13, 27, 31, 37, 39, 81, 85, 91, 93, 109, 111, 117, 121, 243, 247, 253, 255, 271, 273, 279, 283, 325, 327, 333, 337, 351, 355, 361, 363, 729, 733, 739, 741, 757, 759, 765, 769, 811, 813, 819, 823, 837, 841, 847, 849, 973, 975, 981, 985, 999, 1003, 1009
Offset: 0
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000
- Emeric Deutsch and B. E. Sagan, Congruences for Catalan and Motzkin numbers and related sequences, arXiv:math/0407326 [math.CO], 2004; J. Num. Theory 117 (2006), 191-215.
Programs
-
Mathematica
Select[Range[1,1111,2],Count[IntegerDigits[#,3],2]==0&] (* Harvey P. Dale, Dec 19 2010 *)
-
Python
def A074938(n): return int(bin((n<<1)+(n.bit_count()&1^1))[2:],3) # Chai Wah Wu, Jun 26 2025
Comments