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.

Showing 1-2 of 2 results.

A359634 a(0)=1 and thereafter a(n) is the length of the longest contiguous group of terms in the sequence thus far that add up to n; if no such group exists, set a(n)=0.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 3, 4, 5, 4, 5, 6, 4, 5, 6, 7, 6, 7, 8, 5, 7, 8, 9, 7, 6, 8, 9, 10, 6, 9, 10, 11, 9, 8, 10, 11, 12, 9, 10, 9, 11, 12, 13, 7, 12, 13, 14, 12, 11, 13, 14, 15, 11, 13, 11, 14, 15, 16, 13, 6, 14, 13, 15, 16, 17, 13, 15, 12, 16, 17, 18, 15, 8, 16, 14, 17, 18, 19, 15, 16, 12, 17, 14, 18, 19, 20
Offset: 0

Views

Author

Neal Gersh Tolunsky, Jan 08 2023

Keywords

Comments

If a zero appears, it is not counted as a term in a contiguous grouping. For example, if (10, 30, 0, 60) is our longest group to sum to 100, this counts as 3 terms, not 4. However, in 50 million terms (computed by Kevin Ryde), a zero has not appeared. Why is this?
How does the lower envelope of this sequence behave?

Examples

			a(6) is 4 because in the sequence thus far (1,1,2,2,3,3), the longest run of consecutive terms that sums to 6 is (1,1,2,2), which is 4 terms.
		

Crossrefs

Cf. A331614, A358537. a(1-16) in A138099 are the same.

Programs

  • C
    See Links section.

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Neal Gersh Tolunsky, May 25 2023

Keywords

Examples

			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).
		

Crossrefs

Programs

  • 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
Showing 1-2 of 2 results.