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.

Previous Showing 21-25 of 25 results.

A364606 Numbers k such that the average digit of 2^k is an integer.

Original entry on oeis.org

0, 1, 2, 3, 6, 13, 16, 26, 46, 51, 56, 73, 122, 141, 166, 313, 383
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 29 2023

Keywords

Examples

			2^26 = 67108864 is an 8-digit number; its average digit is (6+7+1+0+8+8+6+4)/8 = 40/8 = 5, an integer, so 26 is a term.
		

Crossrefs

Programs

  • Maple
    q:= n-> (l-> irem(add(i, i=l), nops(l))=0)(convert(2^n, base, 10)):
    select(q, [$0..400])[];  # Alois P. Heinz, Jul 29 2023
  • Mathematica
    Select[Range[0, 2^12], IntegerQ@ Mean@ IntegerDigits[2^#] &] (* Michael De Vlieger, Jul 29 2023 *)
  • PARI
    isok(k) = my(d=digits(2^k)); !(vecsum(d) % #d); \\ Michel Marcus, Jul 29 2023
    
  • Python
    from itertools import count, islice
    from gmpy2 import mpz, digits
    def A364606_gen(startvalue=0): # generator of terms >= startvalue
        m = mpz(1)<A364606_list = list(islice(A364606_gen(),10)) # Chai Wah Wu, Jul 31 2023

Formula

{ k : A001370(k) mod A034887(k) = 0 }.

A379865 Number of base 10 digits of 2^(p-1)*(2^p-1) where p = prime(n).

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 12, 14, 18, 19, 22, 25, 26, 28, 32, 36, 37, 41, 43, 44, 48, 50, 54, 59, 61, 62, 65, 66, 68, 77, 79, 83, 84, 90, 91, 95, 98, 101, 104, 108, 109, 115, 116, 119, 120, 127, 134, 137, 138, 140, 144, 145, 151, 155, 159, 162, 163, 167, 169, 171, 177
Offset: 1

Views

Author

Darío Clavijo, Jan 04 2025

Keywords

Crossrefs

Programs

  • Mathematica
    A379865[n_] := IntegerLength[2^(# - 1)*(2^# - 1)] & [Prime[n]];
    Array[A379865, 100] (* Paolo Xausa, Jan 08 2025 *)
  • Python
    from sympy import prime
    def a(n):
      p = prime(n)
      return len(str((1 << (p-1)) * ((1 << p) - 1)))
    print([a(n) for n in range(1,63)])

Formula

a(n) = A055642(A060286(n)).

A071423 a(n) = a(n-1) + number of decimal digits of 2^n. Number of decimal digits of concatenation of first n powers of 2.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 12, 15, 18, 22, 26, 30, 34, 39, 44, 49, 55, 61, 67, 74, 81, 88, 95, 103, 111, 119, 128, 137, 146, 156, 166, 176, 186, 197, 208, 219, 231, 243, 255, 268, 281, 294, 307, 321, 335, 349, 364, 379, 394, 410, 426, 442, 458, 475, 492, 509, 527, 545
Offset: 1

Views

Author

Labos Elemer, May 27 2002

Keywords

Crossrefs

Cf. A058183.

Programs

  • Mathematica
    Do[s=s+Length[IntegerDigits[2^n]]; Print[s], {n, 1, 128}]
    nxt[{n_,a_}]:={n+1,a+IntegerLength[2^(n+1)]}; NestList[nxt,{1,1},60][[All,2]] (* Harvey P. Dale, Nov 11 2022 *)

Formula

a(n) = a(n-1)+A034887(n). [R. J. Mathar, Sep 11 2009]
a(n) = 0.5 log 2/log 10 * n^2 + O(n)

Extensions

An incorrect g.f. was deleted by N. J. A. Sloane, Sep 13 2009
Formula from Charles R Greathouse IV, Apr 28 2010

A329734 a(n) = (10^(1 + floor((n-1) * log_10 2)) + 1)^n, n >= 0.

Original entry on oeis.org

1, 11, 121, 1331, 14641, 10510100501, 1061520150601, 107213535210701, 1008028056070056028008001, 1009036084126126084036009001, 1010045120210252210120045010001, 100110055016503300462046203300165005500110001, 1001200660220049507920924079204950220006600120001
Offset: 0

Views

Author

Daniel Forgues, Nov 19 2019

Keywords

Comments

a(n), n >= 1, gives all the binomial coefficients (without overlap, since binomial(n,k) < 2^(n-1) for n >= 3) of the n-th row of Pascal's triangle (A007318). The k-th "digit", 0 <= k <= n, of the base 10^(d(2^(n-1))) representation of a(n) gives binomial(n,k), albeit with leading zeros: binomial(n,k) = (a(n) div (10^(d(2^(n-1))))^k) mod 10^(d(2^(n-1))), where div means integer division.
A092846 uses number of digits of binomial(n, floor(n/2)) instead [optimal], but requires the evaluation of central binomial coefficients. a(n) uses number of digits of 2^(n-1) [not optimal], but does not require the evaluation of any binomial coefficient.

Examples

			a(9) = (10^3 + 1)^9 = 1009036084126126084036009001 = 1:009:036:084:126:126:084:036:009:001 (base 10^3, since 2^8 has 3 decimal digits).
		

Crossrefs

Cf. A007318, A092846 (uses number of digits of central binomial coefficients).

Programs

  • Mathematica
    d[n_] := Floor[Log[10, 10*n]]; a[n_] := (10^(d[2^(n - 1)]) + 1)^n; Array[a, 12] (* Amiram Eldar, Nov 23 2019 *)

Formula

a(0) = 1; a(n) = (10^(d(2^(n-1))) + 1)^n, n >= 1, where d(2^(n-1)) = 1 + floor((n-1) * log_10 2) = A034887(n-1) is the number of [decimal] digits of 2^(n-1).

A364615 Numbers k such that the average of the decimal digits of 2^k is closer to 9/2 (the expected average for random digits) than for any smaller power of 2.

Original entry on oeis.org

0, 1, 2, 8, 14, 20, 29, 47, 62, 80, 113, 134, 182, 206, 281, 287, 299, 326, 419, 500, 560, 620, 638, 674, 833, 911, 1271, 1289, 1376, 1418, 1583, 1670, 1814, 2273, 2753, 3365, 3794, 4127, 4160, 4202, 4280, 4292, 4538, 4553, 4646, 4805, 4952, 4979, 5105, 5276
Offset: 1

Views

Author

Keywords

Comments

The average of the digits of 2^k is never exactly 9/2, because the sum of digits cannot be divisible by 3.
Conjecture: for each term k > 1, digitsum(2^k) - (9/2)*number_of_digits(2^k) = 1/2 if k is odd, -1/2 if k is even. - Jon E. Schoenfield, Jul 30 2023

Examples

			   k |   2^k | average of digits | distance from 9/2 | new minimum?
  ---+-------+-------------------+-------------------+-------------
   0 |     1 |         1         |        7/2        |     yes
   1 |     2 |         2         |        5/2        |     yes
   2 |     4 |         4         |        1/2        |     yes
   3 |     8 |         8         |        7/2        |
   4 |    16 |        7/2        |         1         |
   5 |    32 |        5/2        |         2         |
   6 |    64 |         5         |        1/2        |
   7 |   128 |       11/3        |        5/6        |
   8 |   256 |       13/3        |        1/6        |     yes
   9 |   512 |        8/3        |       11/6        |
  10 |  1024 |        7/4        |       11/4        |
  11 |  2048 |        7/2        |         1         |
  12 |  4096 |       19/4        |        1/4        |
  13 |  8192 |         5         |        1/2        |
  14 | 16384 |       22/5        |        1/10       |     yes
		

Crossrefs

Previous Showing 21-25 of 25 results.