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.

A363279 a(0)=1; a(1)=2. For n>1, a(n) is the number of contiguous groups in the sequence thus far whose sum is n.

This page as a plain text file.
%I A363279 #19 May 27 2023 02:40:16
%S A363279 1,2,1,2,1,1,2,3,1,2,4,1,3,5,4,3,5,5,2,4,6,4,4,5,2,8,5,4,7,6,6,3,8,7,
%T A363279 5,7,5,6,11,5,6,9,11,2,6,10,8,6,6,11,7,7,10,6,10,7,6,11,11,4,9,13,6,
%U A363279 10,11,9,8,7,9,9,10,10,6,14,10,9,8,11,7,11,12,9,11,11,10,7
%N A363279 a(0)=1; a(1)=2. For n>1, a(n) is the number of contiguous groups in the sequence thus far whose sum is n.
%H A363279 Neal Gersh Tolunsky, <a href="/A363279/b363279.txt">Table of n, a(n) for n = 0..10000</a>
%H A363279 Neal Gersh Tolunsky, <a href="/A363279/a363279.png">Graph of first 10000 terms</a>
%H A363279 Neal Gersh Tolunsky, <a href="/A363279/a363279_1.png">Graph of first 100000 terms</a>
%e A363279 a(2)=1 because in the sequence thus far (1, 2), there is only one contiguous subsequence that sums to n=2: (2).
%e A363279 a(7)=3 because in the sequence thus far (1, 2, 1, 2, 1, 1, 2), there are three groups of consecutive terms that sum to n=7: (1, 2, 1, 2, 1); (2, 1, 2, 1, 1); (1, 2, 1, 1, 2).
%o A363279 (Python)
%o A363279 from collections import Counter
%o A363279 from itertools import count, islice
%o A363279 def agen(): # generator of terms
%o A363279     yield from [1, 2]
%o A363279     sumsn, c =  [2, 3], Counter([1, 2, 3])
%o A363279     for n in count(2):
%o A363279         an = c[n]
%o A363279         yield an
%o A363279         sumsn = [an] + [s + an for s in sumsn]
%o A363279         c.update(sumsn)
%o A363279 print(list(islice(agen(), 86))) # _Michael S. Branicky_, May 25 2023
%Y A363279 Cf. A331614, A359634, A358537.
%K A363279 nonn
%O A363279 0,2
%A A363279 _Neal Gersh Tolunsky_, May 25 2023