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.

A186775 Numbers k such that digitsum(2^k) > digitsum(2^(k+1)).

Original entry on oeis.org

3, 4, 8, 9, 15, 16, 20, 21, 23, 24, 26, 28, 29, 33, 34, 36, 39, 40, 41, 46, 48, 51, 52, 55, 56, 57, 60, 63, 64, 67, 68, 69, 74, 75, 76, 77, 80, 82, 83, 85, 86, 88, 91, 92, 94, 95, 97, 98, 100, 102, 106, 108, 112, 113, 116, 118, 121, 124, 126
Offset: 1

Views

Author

Thomas Nordhaus, Feb 26 2011

Keywords

Comments

If 2^k and 2^(k+1) acted like random numbers of their size, the probability that k would be in the sequence would be 1/2 + O(1/k). So very possibly a(n) ~ 2n. - Charles R Greathouse IV, Aug 08 2022

Examples

			3 is in the sequence because digitsum(2^3) = 8 > 7 = digitsum(2^4).
		

Crossrefs

Cf. A001370.

Programs

  • Mathematica
    DeleteCases[Table[If[Total[Total[IntegerDigits[2^n]]]>Total[IntegerDigits[2^(n+1)]],n,k],{n,0, 10^5}],k] (* J.W.L. (Jan) Eerland, Aug 08 2022 *)
  • Python
    from itertools import count, islice, pairwise
    def ds2(n): return sum(map(int, str(1< t[1])
    print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 08 2022
  • Sage
    def is_A186775(n): return sum((2^n).digits()) > sum((2^(n+1)).digits()) # D. S. McNeil, Feb 27 2011