[go: up one dir, main page]

login
A272697
Powers of 2 with exactly one odd decimal digit.
0
1, 16, 32, 128, 256, 1024, 4096, 262144, 524288, 8388608
OFFSET
1,2
COMMENTS
Inspired by A068994 (Powers of 2 such that number of odd digits is 0).
No additional terms up to 2^10000.
No additional terms < 2^500000. - Chai Wah Wu, May 22 2016
No additional terms < 2^(10^10). - Michael S. Branicky, Apr 16 2023
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 *)
PROG
(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
CROSSREFS
Sequence in context: A235056 A115686 A088112 * A232510 A339356 A282832
KEYWORD
nonn,base
AUTHOR
Seiichi Manyama, May 04 2016
STATUS
approved