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.

A054353 Partial sums of Kolakoski sequence A000002.

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 19, 20, 21, 23, 24, 25, 27, 29, 30, 32, 33, 34, 36, 37, 39, 41, 42, 43, 45, 46, 47, 49, 50, 52, 54, 55, 57, 59, 60, 61, 63, 64, 66, 68, 69, 71, 72, 73, 75, 76, 77, 79, 81, 82, 84, 86, 87, 88, 90, 91, 93, 95, 96, 98, 100
Offset: 1

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Comments

Alternate definition: n such that A000002(n) is different from A000002(n+1). - Nathaniel Johnston, May 02 2011

Crossrefs

Cf. A088568 (partial sums of [3 - 2*A000002(n)]).

Programs

  • Haskell
    a054353 n = a054353_list !! (n-1)
    a054353_list = scanl1 (+) a000002_list
    -- Reinhard Zumkeller, Aug 03 2013
    
  • Mathematica
    a2 = {1, 2, 2}; Do[ a2 = Join[a2, {1+Mod[n-1, 2]}], {n, 3, 50}, {a2[[n]] } ]; Accumulate[a2] (* Jean-François Alcover, Jun 18 2013 *)
  • Python
    from itertools import accumulate
    def alst(nn):
      K = Kolakoski() # using Kolakoski() in A000002
      return list(accumulate(next(K) for i in range(1, nn+1)))
    print(alst(66))   # Michael S. Branicky, Jan 12 2021

Formula

A000002(a(n)) = (3+(-1)^n)/2; A000002(a(n)+1)=(3-(-1)^n)/2. - Benoit Cloitre, Oct 16 2005
a(n) = n + A074286(n) = 2*n - A156077(n) = A156077(n) + 2*A074286(n). - Jean-Christophe Hervé, Oct 05 2014