login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
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, 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, 10, 11, 9, 8, 7, 9, 9, 10, 10, 6, 14, 10, 9, 8, 11, 7, 11, 12, 9, 11, 11, 10, 7 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
Neal Gersh Tolunsky, Graph of first 10000 terms
Neal Gersh Tolunsky, Graph of first 100000 terms
EXAMPLE
a(2)=1 because in the sequence thus far (1, 2), there is only one contiguous subsequence that sums to n=2: (2).
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).
PROG
(Python)
from collections import Counter
from itertools import count, islice
def agen(): # generator of terms
yield from [1, 2]
sumsn, c = [2, 3], Counter([1, 2, 3])
for n in count(2):
an = c[n]
yield an
sumsn = [an] + [s + an for s in sumsn]
c.update(sumsn)
print(list(islice(agen(), 86))) # Michael S. Branicky, May 25 2023
CROSSREFS
Sequence in context: A078349 A266476 A081327 * A205781 A357982 A280444
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, May 25 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 16 21:21 EDT 2024. Contains 375191 sequences. (Running on oeis4.)