A032915 Numbers whose set of base-8 digits is {1,3}.
1, 3, 9, 11, 25, 27, 73, 75, 89, 91, 201, 203, 217, 219, 585, 587, 601, 603, 713, 715, 729, 731, 1609, 1611, 1625, 1627, 1737, 1739, 1753, 1755, 4681, 4683, 4697, 4699, 4809, 4811, 4825, 4827, 5705, 5707, 5721, 5723, 5833, 5835
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[n: n in [1..6000] | Set(IntegerToSequence(n, 8)) subset {1, 3}]; // Vincenzo Librandi, Jun 01 2012
-
Mathematica
Flatten[Table[FromDigits[#,8]&/@Tuples[{1,3},n],{n,5}]] (* Vincenzo Librandi, Jun 01 2012 *)
-
Python
def A032915(n): return (int(bin(m:=n+1)[3:],8)<<1) + ((1<<3*(m.bit_length()-1))-1)//7 # Chai Wah Wu, Oct 13 2023