A272697 Powers of 2 with exactly one odd decimal digit.
1, 16, 32, 128, 256, 1024, 4096, 262144, 524288, 8388608
Offset: 1
Programs
-
Mathematica
Select[2^Range[0, 50000], Total@ Pick[DigitCount@ #, {1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, 1] == 1 &] (* Michael De Vlieger, May 04 2016 *) od1Q[n_]:=Count[IntegerDigits[n],?(OddQ[#]&)]==1; Select[2^Range[0,100],od1Q] (* _Harvey P. Dale, Sep 04 2024 *)
-
Ruby
ary = [1] s = 1 (1..10 ** 4).each{|i| s *= 2 j = s.to_s.split('').map(&:to_i).select{|i| i % 2 == 1}.size ary << s if j == 1 } p ary
Comments