login
A054353
Partial sums of Kolakoski sequence A000002.
38
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,2
COMMENTS
Alternate definition: n such that A000002(n) is different from A000002(n+1). - Nathaniel Johnston, May 02 2011
LINKS
O. Bordelles and B. Cloitre, Bounds for the Kolakoski Sequence, J. Integer Sequences, 14 (2011), #11.2.1.
Bertran Steinsky, A Recursive Formula for the Kolakoski Sequence A000002, J. Integer Sequences, Vol. 9 (2006), Article 06.3.7.
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
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 *)
PROG
(Haskell)
a054353 n = a054353_list !! (n-1)
a054353_list = scanl1 (+) a000002_list
-- Reinhard Zumkeller, Aug 03 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
CROSSREFS
Cf. A088568 (partial sums of [3 - 2*A000002(n)]).
Sequence in context: A238246 A330998 A099467 * A284555 A031948 A247523
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 07 2000
STATUS
approved