cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A272698 Powers of 2 with exactly one even decimal digit.

Original entry on oeis.org

2, 4, 8, 16, 32, 512
Offset: 1

Views

Author

Seiichi Manyama, May 04 2016

Keywords

Comments

The number of even digits of powers of 2 is more than 0. However, it seems there are few powers of 2 with 1 even digit.
If there are any other terms in this sequence, they are greater than 2^10^10. - Charles R Greathouse IV, May 04 2016

Programs

  • Mathematica
    Select[2^Range[0, 50000], Total@ Pick[DigitCount@ #, {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, 1] == 1 &] (* Michael De Vlieger, May 04 2016 *)
    Select[2^Range[200],Count[IntegerDigits[#],?EvenQ]==1&] (* _Harvey P. Dale, Aug 20 2017 *)
  • PARI
    is(n)=my(d=digits(n)); n>1 && n>>valuation(n,2)==1 && sum(i=1,#d,d[i]%2==0)==1 \\ Charles R Greathouse IV, May 04 2016
  • Ruby
    ary = []
    s = 1
    (1..10 ** 4).each{|i|
      s *= 2
      j = s.to_s.split('').map(&:to_i).select{|i| i % 2 == 0}.size
      ary << s if j == 1
    }
    p ary