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-30 of 42 results. Next

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

A175512 (Digit sum of 7^n) mod n.

Original entry on oeis.org

0, 1, 1, 3, 2, 4, 4, 7, 1, 3, 5, 1, 0, 2, 4, 4, 7, 1, 3, 16, 19, 9, 16, 1, 22, 8, 10, 21, 5, 28, 22, 7, 28, 6, 17, 28, 4, 16, 19, 22, 25, 10, 40, 43, 28, 3, 34, 40, 31, 34, 13, 40, 8, 1, 49, 43, 10, 9, 34, 19, 22, 8, 19, 40, 52, 64, 0, 66, 37, 49, 52, 55, 58, 70, 37, 49, 11, 64, 6, 25, 28, 67, 43, 55, 40, 20, 64, 13, 8, 28, 49, 34, 82, 0, 79, 82, 85, 61, 73, 67
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[Plus@@IntegerDigits[7^n],n],{n,150}] (* Harvey P. Dale, Dec 16 2010 *)

A066538 Sum of the digits of the n-th Mersenne prime (A000668).

Original entry on oeis.org

3, 7, 4, 10, 19, 13, 28, 46, 73, 112, 139, 154, 697, 847, 1675, 3106, 3106, 4258, 5755, 5950, 13216, 13693, 14980, 27202, 28939, 31339, 60337, 116455, 149365, 179488, 291745, 1026544, 1163443, 1704376, 1893388, 4038358, 4092673, 9440671, 18243946, 28445131, 32580433, 35170384, 41201947, 44142151, 50349694, 57766339, 58416637
Offset: 1

Views

Author

Robert G. Wilson v, Jan 06 2002

Keywords

Comments

From Gord Palameta, Jul 21 2018: (Start)
a(38) and a(39) were calculated by Enoch Haga, Sep 07 1999 and Dec 17 2001; a(40) through a(42) were calculated by Andrew Rupinski, Mar 12 2005. (See the Carlos Rivera link.)
It appears that asymptotically a(n)/A000043(n) = 9*log_10(2)/2. (End)

Crossrefs

Subsequence of: A007953, A007605.
Cf. A001370 (sum of digits of 2^n).

Programs

  • Mathematica
    ep = {the exponents from A000043}; a = {}; Do[ a = Append[a, Apply[ Plus, IntegerDigits[ 2^ep[[n]] - 1]]], {n, 1, 47} ]; a
    (* Second program: *)
    Array[Total@ IntegerDigits[2^MersennePrimeExponent@ # - 1] &, 45] (* Michael De Vlieger, Jul 22 2018 *)

Formula

a(n) = A007953(A000668(n)). - Amiram Eldar, Oct 16 2024

Extensions

Definition corrected by Omar E. Pol, Apr 01 2008
a(38)-a(47) from Gord Palameta, Jul 21 2018

A112435 Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 4.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 16, 23, 28, 38, 45, 42, 41, 41, 36, 34, 32, 31, 30, 28, 29, 33, 34, 37, 44, 42, 37, 41, 39, 41, 38, 43, 40, 39, 39, 46, 45, 47, 54, 51, 45, 44, 43, 39, 42, 42, 39, 43, 43, 38, 43, 44, 40, 37, 40, 33, 32, 29, 36, 35, 39, 45, 49, 51, 48, 52, 47
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(16)=38 and the loop has 312 terms. It is exactly the same loop as in A112433 "Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 2" and the first term of this 4-loop is the first term of that 2-loop . Computed by Gilles Sadowski.

Examples

			a(16)=38 because 4 + 4 + 8 + 1+6 +2+3 + 2+8 = 38
		

Crossrefs

Programs

  • Mathematica
    nxt[{t_,a_}]:={Take[Join[t,IntegerDigits[Total[t]]],-10],Total[t]}; Join[ {0,0,0,0,0,0,0,0,0},NestList[nxt,{{0,0,0,0,0,0,0,0,0,4},4},80][[All,2]]] (* Harvey P. Dale, Jun 22 2019 *)

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
    

A253298 Digital root for the following sequences, F(4*n)/F(4); F(12*n)/F(12); F(20*n)/F(20), where the pattern increases by 8, ad infinitum, with the Fibonacci numbers F = A000045.

Original entry on oeis.org

1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8, 9, 1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8, 9, 1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8, 9, 1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8, 9
Offset: 1

Views

Author

Peter M. Chema, Dec 30 2014

Keywords

Comments

Cyclical and palindromic in two parts with periodicity 18: {1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8, 9}.
Digital root of the period is 9, its mean and median is 5, and its product is (9!)^2.
See A253368 for the initial motivation for this sequence.
From Peter M. Chema, Jul 04 2016: (Start)
A composite of three respective digital root sequences in alternation: a "halving sequence" of 1, 5, 7, 8, 4, 2, a "doubling sequence" of 7, 5, 1, 2, 4, 8, and a three-six-nine circuit of 3, 3, 9, 6, 6, 9.
Also the digital root of A000045(4n)/3 or A004187(n). In general terms, sequences defined by Fib(x*n)/ Fib(x) where x=(8*a-4) all share the same digital root (e.g., F(4*n)/F(4); F(12*n)/F(12); F(20*n)/F(20); F(28*n)/F(28); F(36*n)/F(36), etc.) (End)

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[ Fibonacci[ 12n]/144, 9]; Array[f, 5*18] (* Robert G. Wilson v, Jan 23 2015 *)
    LinearRecurrence[{1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1},{1, 7, 3, 5, 5, 3, 7, 1, 9, 8, 2, 6, 4, 4, 6, 2, 8},72] (* Ray Chandler, Aug 12 2015 *)

Formula

a(n) = A010888(A253368(n)).
G.f.: x*(1 + 7*x + 3*x^2 + 5*x^3 + 5*x^4 + 3*x^5 + 7*x^6 + x^7 + 9*x^8 + 8*x^9 + 2*x^10 + 6*x^11 + 4*x^12 + 4*x^13 + 6*x^14 + 2*x^15 + 8*x^16 + 9*x^17)/(1 - x^18). - Vincenzo Librandi, Mar 28 2016

Extensions

Edited. Numbers and name changed to fit A253368. Formula adapted. Cross reference added. - Wolfdieter Lang, Jan 28 2015
Name generalized by Peter M. Chema, Jul 04 2016

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

A071906 Sum of digits of 2^n (mod 2).

Original entry on oeis.org

1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Santi Spadaro, Jun 13 2002

Keywords

Crossrefs

Cf. A001370.

Programs

  • Mathematica
    f[n_] := Mod[Plus @@ IntegerDigits[2^n], 2]; Table[ f@n, {n, 0, 104}] (* Robert G. Wilson v, May 04 2009 *)
  • PARI
    a(n) = sumdigits(2^n) % 2; \\ Michel Marcus, Apr 20 2017

A112437 Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 12, 15, 21, 24, 30, 21, 21, 18, 24, 24, 27, 33, 36, 36, 39, 45, 45, 48, 51, 48, 48, 51, 48, 48, 54, 51, 45, 48, 48, 48, 51, 51, 48, 48, 48, 48, 54, 57, 57, 57, 57, 57, 60, 54, 51, 45, 42, 36, 39, 42, 42, 39, 45, 45, 42, 42, 42, 36, 36, 36, 39, 45
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(24)=36 and the loop has 104 terms. It is the same loop as in A112434 "Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 3"; the first term of this 6-loop is the 47th term of that 3-loop and the first term of that 3-loop is the 59th of this 6-loop. Computed by Gilles Sadowski.

Examples

			a(24)=36 because 1+8 + 2+4 + 2+4 + 2+7 + 3+3 = 36
		

Crossrefs

A293011 a(n) is the smallest positive k such that f(k) = n*g(k) where f = A007953 and g = A000120, or 0 if no such k exists.

Original entry on oeis.org

1, 2, 6, 4, 32, 48, 16, 8, 288, 64, 128, 8196, 256, 2048, 16896, 278528, 2097664, 589824, 4096, 8192, 8388609, 16384, 536870944, 268435488, 65536, 32768, 268959744, 17179869440, 524288, 4294967298, 1048576, 8589934594, 8589934596
Offset: 1

Views

Author

Altug Alkan, Sep 28 2017

Keywords

Comments

Conjecture: a(n) > 0 for all n >= 1.
Numbers n such that a(n) is not a power of 2 are 3, 6, 9, 12, 15, 16, 17, 18, ...
a(21) = 8388609 = 2^23 + 1 is the second odd term of this sequence after a(1) = 1.
Smallest n such that a(n + 1) = a(n) + 2 is 32 and a(32) = 2*(2^32 + 1).
For n <= 170, A000120(a(n)) <= 2. - Robert Israel, Nov 22 2019

Examples

			a(9) = 288 = 2^8 + 2^5 because A007953(288) = 2 + 8 + 8 = 18, 18 / 2 = 9 and 288 is the least number with this property.
		

Crossrefs

Programs

  • Maple
    # This code returns a(n) if A000120(a(n)) <= 3 and it can prove that no
    # smaller number with A000120 >= 4 can have A007953 large enough. If it
    # can't prove that, it returns FAIL.
    sdd:= n -> convert(convert(n,base,10),`+`):
    g:= proc(n) local found, k1, k2, k3, x, y, m,bd;
      found:= false;
      for k1 from 1 while not found do
        for k2 from 0 to k1-1 do
          x:= 2^k1 + 2^k2;
          if sdd(x) = 2*n then found:= true; break fi
      od od;
      for k1 from 0 to ilog2(x) do
        if sdd(2^k1) = n then x:= 2^k1; break fi
      od;
      m:= ilog10(x);
      bd:= floor(x/10^m)+9*m;
      if bd <= 3*n then return x fi;
      found:= false;
      for k1 from 2 to ilog2(x) while not found do
        for k2 from 1 to k1-1 while not found do
          for k3 from 0 to k2-1 do
             y:= 2^k1 + 2^k2 + 2^k3;
             if y > x or sdd(y) = 3*n then found:= true; break fi;
      od od od;
      if found then x:= min(x,y) fi;
      bd:= floor(x/10^m)+9*m;
      if bd <= 4*n then x else FAIL fi;
    end proc:
    map(g, [$1..50]); # Robert Israel, Nov 22 2019
  • PARI
    a(n) = {my(k=1); while ((hammingweight(k))*n != sumdigits(k), k++); k; }
Previous Showing 21-30 of 42 results. Next