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.

Showing 1-10 of 19 results. Next

A001370 Sum of digits of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 7, 5, 10, 11, 13, 8, 7, 14, 19, 20, 22, 26, 25, 14, 19, 29, 31, 26, 25, 41, 37, 29, 40, 35, 43, 41, 37, 47, 58, 62, 61, 59, 64, 56, 67, 71, 61, 50, 46, 56, 58, 62, 70, 68, 73, 65, 76, 80, 79, 77, 82, 92, 85, 80, 70, 77
Offset: 0

Views

Author

Keywords

Comments

Same digital roots as A065075 (sum of digits of the sum of the preceding numbers) and A004207 (sum of digits of all previous terms); they enter into the cycle {1 2 4 8 7 5}. - Alexandre Wajnberg, Dec 11 2005
It is believed that a(n) ~ n*9*log_10(2)/2, but this is an open problem. - N. J. A. Sloane, Apr 21 2013
The Radcliffe preprint shows that a(n) > log_4(n). - M. F. Hasler, May 18 2017
Sierpiński shows that if n >= A137284(k-1) then a(n) >= k (Problem 209). - David Radcliffe, Dec 26 2022

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. sum of digits of k^n: A004166 (k=3), A065713 (k=4), A066001(k=5), A066002 (k=6), A066003(k=7), A066004 (k=8), A065999 (k=9), A066005 (k=11), A066006 (k=12).

Programs

  • Haskell
    a001370 = a007953 . a000079  -- Reinhard Zumkeller, Aug 14 2015
  • Maple
    seq(convert(convert(2^n,base,10),`+`),n=0..1000); # Robert Israel, Mar 29 2015
  • Mathematica
    Table[Total[IntegerDigits[2^n]], {n, 0, 55}] (* Vincenzo Librandi, Oct 08 2013 *)
  • PARI
    a(n)=sumdigits(2^n); \\ Michel Marcus, Nov 01 2013
    
  • Python
    [sum(map(int, str(2**n))) for n in range(56)] # David Radcliffe, Mar 29 2015
    

Formula

a(n) = A007953(A000079(n)). - Michel Marcus, Nov 01 2013

A118738 Number of ones in binary expansion of 5^n.

Original entry on oeis.org

1, 2, 3, 6, 5, 6, 7, 8, 12, 13, 11, 15, 13, 14, 17, 20, 20, 20, 24, 19, 26, 29, 25, 27, 30, 19, 31, 33, 29, 36, 37, 33, 39, 34, 42, 40, 44, 42, 38, 46, 53, 54, 49, 52, 52, 53, 50, 49, 54, 60, 58, 60, 54, 64, 58, 74, 61, 67, 74, 65, 61, 77, 74, 81, 86, 78, 87, 85, 82, 89, 83, 79
Offset: 0

Views

Author

Zak Seidov, May 22 2006

Keywords

Comments

Also binary weight of 10^n, which is verified easily enough: 10^n = 2^n * 5^n; it is obvious that 2^n in binary is a single 1 followed by n 0's, therefore, in the binary expansion of 2^n * 5^n, the 2^n contributes only the trailing zeros. - Alonso del Arte, Oct 28 2012
Conjecture: a(n)/n -> log_4(5) = 1.160964... as n -> oo. - M. F. Hasler, Apr 17 2024

Examples

			a(2) = 3 because 5^2 = 25 is 11001, which has 3 on bits.
		

Crossrefs

Cf. A000120 (Hamming weight), A000351 (5^n), A061785 (floor(log_2(5^n))), A118737 (number of bits 0 in 5^n).
Cf. A011754 (analog for 3^n).

Programs

  • Magma
    [&+Intseq(5^n, 2): n in [0..100]]; // Vincenzo Librandi, Nov 13 2024
  • Maple
    seq(convert(convert(5^n,base,2),`+`),n=0..100); # Robert Israel, Dec 24 2017
  • Mathematica
    Table[DigitCount[5^n, 2, 1], {n, 0, 71}] (* Ray Chandler, Sep 29 2006 *)
  • PARI
    a(n) = hammingweight(5^n) \\ Iain Fox, Dec 24 2017
    
  • Python
    A118738 = lambda n: (5**n).bit_count() # For Python 3.10 and later. - M. F. Hasler, Apr 17 2024
    

Formula

a(n) + A118737(n) = A061785(n) + 1 for n >= 1. - Robert Israel, Dec 24 2017 [corrected by Amiram Eldar, Jul 27 2023]
a(n) = A000120(A000351(n)) = Hammingweight(5^n). - M. F. Hasler, Apr 17 2024

A078839 Numbers k such that the binary expansion of 3^k has the same number of 0's and 1's.

Original entry on oeis.org

2, 12, 69, 73, 150, 184, 252, 328, 339, 464, 483, 541, 729, 747, 758, 763, 1014, 1047, 1090, 1094, 1158, 1264, 1359, 1601, 1679, 1693, 1698, 1780, 2368, 2641, 2815, 3292, 3393, 3606, 3682, 3857, 3909, 3919, 3963, 4087, 4111, 4289, 4314, 5017, 5398, 5466
Offset: 1

Views

Author

Benoit Cloitre, Dec 06 2002

Keywords

Comments

Does the limit of a(n)/n^2 as n -> infinity exist?

Crossrefs

Programs

  • Mathematica
    balanced[n_] := Module[{d=IntegerDigits[n, 2]}, Plus@@d==Length[d]/2]; Select[Range[0, 5500], balanced[3^# ]&]
  • PARI
    is(n)=hammingweight(n=3^n)==hammingweight(bitneg(n,#binary(n))) \\ Charles R Greathouse IV, Mar 29 2013

A261009 Write 2^n in base 3, add up the "digits".

Original entry on oeis.org

1, 2, 2, 4, 4, 4, 4, 6, 4, 8, 8, 10, 10, 8, 10, 16, 12, 14, 12, 16, 14, 18, 16, 12, 10, 12, 14, 20, 20, 22, 24, 26, 24, 22, 22, 22, 18, 20, 26, 28, 28, 28, 26, 30, 30, 30, 26, 26, 26, 32, 38, 40, 38, 38, 28, 34, 40, 42, 38, 40, 46, 40, 38, 42, 48, 44, 42, 40, 42, 48, 48, 44
Offset: 0

Views

Author

N. J. A. Sloane, Aug 14 2015

Keywords

Comments

Comment from Jean-Paul Allouche, Oct 25 2015: As mentioned by Holdum et al. (2015) the following problem, cited in "Concrete Mathematics" by Graham, Knuth, and Patashnik (1994), is still open: prove that for all n > 256, binomial(2n,n) is either divisible by 4 or by 9 (cf. A000984). This can be easily reduced to show that, for all k >= 9, 2*a(k) - a(k+1) >= 4. This has been proved up to huge values of k (Holdum et al. mention k = 10^{13}).
For additional information about the divisibility of binomial(2n,n) by squares see the comments and references in A000984, - N. J. A. Sloane, Oct 29 2015

Examples

			2^7 = 128_10 = 11202_3, so a(7) = 1+1+2+0+2 = 6.
		

Crossrefs

Sum of digits of k^n in base b for various pairs (k,b): A001370 (2,10), A011754 (3,2), A261009 (2,3), A261010 (5,3).

Programs

  • Haskell
    a261009 = a053735 . a000079  -- Reinhard Zumkeller, Aug 14 2015
  • Maple
    S:=n->add(i,i in convert(2^n,base,3)); [seq(S(n),n=0..100)];
  • Mathematica
    Table[Total@ IntegerDigits[2^n, 3], {n, 0, 100}] (* Giovanni Resta, Aug 14 2015 *)
  • PARI
    a(n) = vecsum(digits(2^n, 3)); \\ Michel Marcus, Aug 14 2015
    

Formula

a(n) = A053735(A000079(n)). - Michel Marcus, Aug 14 2015

A372097 Exponents k where A000120(3^k) - A070939(3^k)/2 reaches a new minimum.

Original entry on oeis.org

0, 2, 4, 7, 16, 24, 40, 49, 53, 102, 104, 126, 174, 226, 379, 768, 831, 832, 1439, 1452, 1914, 2291, 2731, 3000, 3363, 3472, 5608, 5883, 6725, 6787, 7438, 8786, 10280, 11948, 12190, 13135, 15170, 15645, 22407, 26232, 27099, 32773, 33085, 40189, 40523, 48068, 51187
Offset: 1

Views

Author

Hugo Pfoertner, Apr 25 2024

Keywords

Comments

These are the k-values of the lower envelope of the scatter band of the deviation of the binary weight of 3^k from half the length of the corresponding binary number. The corresponding negated differences are given in A372098.

Crossrefs

Programs

  • PARI
    a372097(upto) = {my (dm=-oo); for (k=0, upto, my (p=3^k, h=hammingweight(p), b=#binary(p)/2,d=b-h); if (d>dm, print1(k,", "); dm=d))};
    a372097(60000)

A372098 a(n) = A070939(3^k) - 2*A000120(3^k) with k = A372097(n).

Original entry on oeis.org

-1, 0, 1, 2, 4, 7, 8, 12, 15, 18, 25, 26, 30, 51, 75, 78, 84, 129, 133, 148, 170, 180, 183, 189, 209, 265, 279, 285, 287, 336, 369, 388, 406, 412, 445, 469, 496, 581, 711, 737, 741, 742, 873, 939, 994, 1044, 1078, 1111, 1157, 1158, 1492, 1636, 1767, 1914, 1933
Offset: 1

Views

Author

Hugo Pfoertner, Apr 25 2024

Keywords

Comments

a(n)/2 are the negated differences at supporting points of the lower envelope of the scatter band of the deviation of the binary weight of 3^k from half the length of the corresponding binary number.

Crossrefs

A372099 Exponents k where A000120(3^k) - A070939(3^k)/2 reaches a new maximum.

Original entry on oeis.org

0, 1, 3, 5, 11, 27, 71, 119, 140, 158, 198, 218, 441, 537, 538, 868, 1092, 2128, 2294, 2343, 2811, 2911, 3849, 4003, 4655, 5079, 5279, 5920, 6269, 6603, 10181, 10574, 12801, 12803, 15563, 15784, 16054, 16253, 17127, 18257, 20187, 21934, 34633, 49209, 76791, 78938
Offset: 1

Views

Author

Hugo Pfoertner, Apr 25 2024

Keywords

Comments

These are the k-values of the upper envelope of the scatter band of the deviation of the binary weight of 3^k from half the length of the corresponding binary number. The corresponding differences are given in A372100.

Crossrefs

Programs

  • PARI
    a372099(upto) = {my(dm=oo); for (k=0, upto, my (p=3^k, h=hammingweight(p), b=#binary(p)/2, d=b-h); if (d
    				

A372100 a(n) = 2*A000120(3^k) - A070939(3^k) with k = A372099(n).

Original entry on oeis.org

1, 2, 3, 4, 8, 17, 23, 29, 38, 39, 44, 56, 57, 58, 91, 114, 145, 147, 156, 168, 182, 208, 219, 239, 277, 297, 300, 307, 331, 360, 367, 442, 452, 477, 487, 492, 507, 513, 568, 571, 614, 893, 963, 1275, 1283, 1288, 1440, 1563, 1702, 1957, 2019, 2440, 2471, 2566, 3004
Offset: 1

Views

Author

Hugo Pfoertner, Apr 25 2024

Keywords

Comments

a(n)/2 are the differences at supporting points of the upper envelope of the scatter band of the deviation of the binary weight of 3^k from half the length of the corresponding binary number.

Crossrefs

A261010 Write 5^n in base 3, add up the "digits".

Original entry on oeis.org

1, 3, 5, 7, 7, 9, 9, 13, 15, 13, 13, 17, 19, 21, 21, 27, 25, 25, 25, 23, 27, 33, 31, 39, 35, 45, 37, 57, 45, 47, 45, 45, 53, 47, 55, 51, 57, 59, 67, 67, 69, 65, 67, 65, 71, 79, 71, 65, 67, 75, 65, 71, 73, 83, 69, 79, 81, 85, 79, 89, 87, 95, 89, 85, 97, 99, 93, 101, 107
Offset: 0

Views

Author

N. J. A. Sloane, Aug 14 2015

Keywords

Crossrefs

Sum of digits of k^n in base b for various pairs (k,b): A001370 (2,10), A011754 (3,2), A261009 (2,3), A261010 (5,3).

Programs

  • Maple
    S:=n->add(i,i in convert(5^n,base,3)); [seq(S(n),n=0..100)];
  • Python
    def digits(n, b=10): # digits of n in base 2 <= b <= 62
        x, y = n, ''
        while x >= b:
            x, r = divmod(x,b)
            y += str(r) if r < 10 else (chr(r+87) if r < 36 else chr(r+29))
        y += str(x) if x < 10 else (chr(x+87) if x < 36 else chr(x+29))
        return y[::-1]
    def A261010(n):
        return sum([int(d) for d in digits(5**n,3)]) # Chai Wah Wu, Aug 14 2015

A364650 Number of powers of 3 whose binary representation contains exactly n 1's.

Original entry on oeis.org

1, 2, 1, 1, 1, 3, 0, 1, 1, 1, 2, 0, 1, 3, 1, 1, 2, 1, 1, 1, 0, 1
Offset: 1

Views

Author

Pontus von Brömssen, Jul 31 2023

Keywords

Comments

Number of numbers k >= 0 such that A011754(k) = n.
Senge and Straus prove that a(n) is finite for all n.
After a(22), the sequence undoubtedly continues 0, 1, 3, 2, 1, 1, 1, 1, 0, 2, 1, 4, 1, 1, 0, 2, 4, 1, 2, 3, 0, 0, 2, 1, 1, 1, 1, 0, ..., but there seem to be proofs only for the first 22 terms (Dimitrov and Howe).

Examples

			There are a(6) = 3 powers of 3 that have exactly 6 binary 1's: 3^5 (11110011 in binary), 3^6 (1011011001), and 3^8 (1100110100001).
There is no power of 3 with exactly 7 binary 1's, so a(7) = 0.
		

Crossrefs

Cf. A011754.
Showing 1-10 of 19 results. Next