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-7 of 7 results.

A332518 a(n+1) is the number of times a(n) is the product of one or more consecutive terms in this sequence so far with a(1) = 1.

Original entry on oeis.org

1, 1, 3, 3, 4, 1, 4, 4, 5, 1, 5, 4, 6, 1, 6, 4, 7, 1, 7, 4, 8, 1, 8, 4, 9, 4, 10, 1, 9, 6, 5, 5, 6, 6, 7, 5, 7, 6, 8, 5, 8, 6, 9, 7, 7, 8, 7, 9, 8, 8, 9, 9, 10, 3, 5, 9, 11, 1, 10, 5, 10, 6, 10, 7, 10, 8, 10, 9, 12, 3, 6, 11, 3, 7, 11, 4, 11, 5, 11, 6, 12, 4
Offset: 1

Views

Author

Rémy Sigrist, Feb 15 2020

Keywords

Comments

This sequence is a multiplicative variant of A331614.
This sequence is unbounded.

Examples

			The first terms, alongside the corresponding products, are:
  n   a(n)  Products
  --  ----  --------
   1     1  a(1)
   2     1  a(1),           a(1)*a(2),  a(2)
   3     3  a(1)*a(2)*a(3), a(2)*a(3),  a(3)
   4     3  a(1)*a(2)*a(3), a(2)*a(3),  a(3),        a(4)
   5     4  a(5)
   6     1  a(1),           a(1)*a(2),  a(2),        a(6)
   7     4  a(5),           a(5)*a(6),  a(6)*a(7),   a(7)
   8     4  a(5),           a(5)*a(6),  a(6)*a(7),   a(7), a(8)
   9     5  a(9)
  10     1  a(1),           a(1)*a(2),  a(2),        a(6), a(10)
  11     5  a(9),           a(9)*a(10), a(10)*a(11), a(11)
  12     4  a(5),           a(5)*a(6),  a(6)*a(7),   a(7), a(8), a(12)
		

Crossrefs

Cf. A331614.

Programs

  • C
    // See Links section.

A358537 For n > 0, a(n) is the total number of terms in all contiguous subsequences of the terms up to a(n-1) that sum to n; a(0) = 1.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 4, 2, 2, 5, 7, 8, 6, 11, 10, 16, 5, 22, 6, 19, 15, 22, 20, 9, 18, 5, 14, 16, 23, 9, 8, 11, 16, 12, 19, 21, 0, 21, 8, 20, 11, 17, 25, 28, 4, 18, 4, 30, 23, 40, 7, 20, 18, 18, 14, 9, 40, 9, 29, 32, 23, 6, 17, 23, 16, 8, 26, 32, 35, 27, 64, 10
Offset: 0

Views

Author

Neal Gersh Tolunsky, Dec 18 2022

Keywords

Examples

			To find a(4), we look at the sequence so far (1, 1, 2, 2) to find contiguous subsequences that sum to 4: (1, 1, 2) and (2, 2). This is five terms in total, so a(4) = 5. Notice that the two subsequences overlap.
a(40) is 11 because the following contiguous subsequences sum to 40: (6, 19, 15); (23, 9, 8); (19, 21); (19, 21, 0). This is a total of 11 terms.
		

Crossrefs

Programs

  • Maple
    N:= 100: V:= Array(0..N):
    V[0]:= 1:
    for n from 0 to N-1 do
      s:= 0;
      for j from n to 0 by -1 do
        s:= s + V[j];
        if s > N then break fi;
        if s > n then V[s]:= V[s] + n-j+1 fi;
      od;
    od:
    convert(V,list); # Robert Israel, Feb 16 2023
  • PARI
    { for (n=1, #a=m=vector(72), print1 (a[n] = if (n==1, 1, m[n-1])", "); s = w = 0; forstep (k=n, 1, -1, w++; if ((s += a[k]) > #m, break, s, m[s] += w))) } \\ Rémy Sigrist, Feb 09 2023

Extensions

Data edited by Yifan Xie, Feb 08 2023
More terms from Rémy Sigrist, Feb 09 2023

A358799 a(0) = 0, and for any n >= 0, a(n+1) is the number of ways to write a(n) = a(i) XOR ... XOR a(j) with 0 <= i <= j <= n (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

0, 1, 2, 1, 3, 4, 2, 5, 4, 5, 6, 8, 2, 11, 2, 13, 6, 14, 10, 9, 9, 12, 14, 16, 2, 24, 6, 29, 5, 23, 3, 27, 12, 23, 9, 26, 17, 13, 26, 19, 15, 32, 4, 46, 2, 51, 1, 45, 6, 48, 6, 49, 7, 41, 9, 47, 10, 49, 17, 37, 21, 38, 23, 36, 24, 49, 30, 48, 24, 52, 22, 45
Offset: 0

Views

Author

Rémy Sigrist, Dec 06 2022

Keywords

Comments

This sequence is a variant of A331614 and A332518; here we use binary XOR, there addition and multiplication, respectively.
This sequence is unbounded (if the sequence was bounded, with greatest value m, then, by the pigeonhole principle, some value, say v, would appear infinitely many times, and the next value after the (m+1)-th occurrence of v would be > m, a contradiction).

Examples

			The first terms, alongside the corresponding pairs (i,j)'s, are:
  n   a(n)  (i,j)'s
  --  ----  ---------------------------------------------------------
   0     0  N/A
   1     1  (0,0)
   2     2  (0,1), (1,1)
   3     1  (2,2)
   4     3  (0,1), (1,1), (3,3)
   5     4  (0,2), (1,2), (2,3), (4,4)
   6     2  (2,5), (5,5)
   7     5  (0,3), (1,3), (2,2), (3,4), (6,6)
   8     4  (0,5), (1,5), (4,6), (7,7)
   9     5  (2,5), (3,6), (4,8), (5,5), (8,8)
  10     6  (0,5), (1,5), (3,8), (4,6), (7,7), (9,9)
  11     8  (0,8), (1,8), (2,6), (3,5), (3,10), (5,6), (6,9), (10,10)
  12     2  (6,11), (11,11)
		

Crossrefs

Programs

  • C
    See Links section.

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.

A359034 a(n+1) is the sum of the number of terms in all groups of contiguous terms that add up to a(n); a(1)=1.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 4, 5, 3, 5, 4, 6, 6, 7, 7, 8, 10, 11, 4, 7, 9, 9, 10, 12, 13, 14, 13, 15, 8, 11, 7, 10, 13, 16, 19, 18, 18, 19, 19, 20, 7, 11, 8, 12, 14, 14, 15, 9, 11, 9, 12, 15, 10, 14, 16, 20, 14, 17, 17, 18, 22, 22, 23, 22, 24, 23, 23, 24, 24, 25, 28, 27, 22
Offset: 1

Views

Author

Neal Gersh Tolunsky, Dec 12 2022

Keywords

Comments

If strongly smoothened, this sequence displays growth. This growth appears to be caused by the number of groups which is increasing by growing length of the sequence roughly proportional to n^(1/2). But the length of the groups appears to be nearly uninfluenced by this. - Thomas Scheuerle, Dec 14 2022

Examples

			a(17) is 10 because in the sequence so far (1, 1, 2, 3, 3, 4, 4, 5, 3, 5, 4, 6, 6, 7, 7, 8), these are the ways of adding contiguous terms to get a(16)=8: (2, 3, 3); (4, 4); (5, 3); (3, 5); (8). This is 10 terms in total, so a(17) is 10. Notice groups (5,3) and (3,5) overlap.
		

Crossrefs

Cf. A331614, A358919. Begins the same as A124056 (until a(13)).

Programs

  • MATLAB
    function a = A359034( max_n )
        a = [1 1];
        for n = 3:max_n
            s = 1; e = 1; sm = 1; c = 0;
            while e < n-1
                while sm < a(n - 1) && e < (n - 1)
                    e = e + 1; sm = sm + a(e);
                end
                if sm == a(n - 1)
                    c = c + (e - s) + 1;
                end
                s = s + 1;
                e = s; sm = a(s);
            end
            a(n) = c + 1;
        end
    end % Thomas Scheuerle, Dec 14 2022

A336037 a(n+1) is the number of times the binary representation of a(n) is the concatenation of that of one or more consecutive terms in this sequence so far with a(1) = 1.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4, 3, 5, 2, 5, 3, 6, 2, 6, 3, 7, 2, 7, 3, 8, 1, 5, 4, 4, 5, 5, 6, 4, 6, 5, 7, 4, 7, 5, 8, 2, 8, 3, 9, 2, 9, 3, 10, 2, 10, 3, 11, 2, 11, 3, 12, 2, 12, 3, 13, 3, 14, 3, 15, 2, 13, 4, 8, 4, 9, 4, 10, 4, 11, 4, 12, 4, 13, 5
Offset: 1

Views

Author

Rémy Sigrist, Jul 07 2020

Keywords

Comments

This sequence has similarities with A331614 and A332518; here we concatenate consecutive terms, there we add and multiply them, respectively.
This sequence is unbounded.

Examples

			The first terms, alongside their binary representation and the corresponding concatenations, are:
  n   a(n)  bin(a(n))  Concatenations
  --  ----  ---------  --------------
   1     1          1  a(1)
   2     1          1  a(1), a(2)
   3     2         10  a(3)
   4     1          1  a(1), a(2), a(4)
   5     3         11  a(1)|a(2), a(5)
   6     2         10  a(3), a(6)
   7     2         10  a(3), a(6), a(7)
   8     3         11  a(1)|a(2), a(5), a(8)
   9     3         11  a(1)|a(2), a(5), a(8), a(9)
  10     4        100  a(10)
		

Crossrefs

Programs

  • PARI
    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-7 of 7 results.