A032912 Numbers whose set of base-5 digits is {1,3}.
1, 3, 6, 8, 16, 18, 31, 33, 41, 43, 81, 83, 91, 93, 156, 158, 166, 168, 206, 208, 216, 218, 406, 408, 416, 418, 456, 458, 466, 468, 781, 783, 791, 793, 831, 833, 841, 843, 1031, 1033, 1041, 1043, 1081, 1083, 1091, 1093, 2031, 2033
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A007091.
Programs
-
Magma
[n: n in [1..2500] | Set(IntegerToSequence(n, 5)) subset {1, 3}]; // Vincenzo Librandi, Jun 01 2012
-
Mathematica
Flatten[Table[FromDigits[#,5]&/@Tuples[{1,3},n],{n,5}]] (* Vincenzo Librandi, Jun 01 2012 *)
-
Python
def A032912(n): return (int(bin(m:=n+1)[3:],5)<<1) + (5**(m.bit_length()-1)-1>>2) # Chai Wah Wu, Oct 13 2023
Comments