login
A032912
Numbers whose set of base-5 digits is {1,3}.
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,2
COMMENTS
Or, Numbers all of whose base-5 digits are odd.
LINKS
MATHEMATICA
Flatten[Table[FromDigits[#, 5]&/@Tuples[{1, 3}, n], {n, 5}]] (* Vincenzo Librandi, Jun 01 2012 *)
PROG
(Magma) [n: n in [1..2500] | Set(IntegerToSequence(n, 5)) subset {1, 3}]; // 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
CROSSREFS
Cf. A007091.
Sequence in context: A320687 A340494 A039567 * A123208 A179652 A253855
KEYWORD
nonn,base
STATUS
approved