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.

Previous Showing 11-20 of 62 results. Next

A347315 a(n) = sum of row beginning with n when inventory sequence A342585 is written as an irregular triangle.

Original entry on oeis.org

0, 2, 6, 11, 17, 24, 32, 40, 51, 63, 76, 89, 102, 116, 132, 149, 169, 188, 208, 228, 249, 272, 297, 322, 349, 377, 404, 432, 461, 494, 528, 562, 597, 632, 667, 703, 740, 778, 820, 862, 903, 945, 991, 1038, 1085, 1132, 1181, 1229, 1277, 1328, 1380, 1434, 1487
Offset: 0

Views

Author

N. J. A. Sloane, Sep 09 2021

Keywords

Comments

The inventory sequence A342585 counts, for k = 0, 1, 2, ..., the k's that have occurred so far, and if zero, restarts with k = 0. The rows end where the zeros occur.
The sequence appears to grow approximately quadratically. More precisely, b(n) = sqrt(a(n)) is roughly a straight line over increasingly large intervals, but the slope is slightly larger at the beginning and then decreasing towards the end of these intervals. For example, on [1..80] the slope is almost exactly 0.72; on [150..250] the slope is roughly 1.0, over [320..420] the slope is again 0.8, over [430..520] it is again 1.0, over [530..620] it is again 0.8; then the slope increases: b(780..1000) is again a nearly straight line with slope 1.67, etc. - M. F. Hasler, Nov 14 2021

Examples

			As an irregular triangle A342585 begins:
   0;
   1,  1,  0;
   2,  2,  2,  0;
   3,  2,  4,  1,  1,  0;
   4,  4,  4,  1,  4,  0;
...
and the row sums are 0, 2, 6, 11, 17, ...
		

Crossrefs

Cf. A342585.

Programs

  • Mathematica
    Join[{0}, Total /@ SplitBy[Block[{c, k, m, nn = 52}, c[0] = 1; Reap[Do[k = 0; While[IntegerQ[c[k]], Set[m, c[k]]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; k++]; Sow[0]; c[0]++, nn]][[-1, -1]]], # == 0 &][[1 ;; -1 ;; 2]]] (* Michael De Vlieger, Oct 12 2021 *)
  • PARI
    A347315_vec(N, c=[], i, s)=vector(N, j, until(c[1+c[i]]++&&!c[i]||j==1, while(#c<=i||#c<=c[i+1], c=concat(c, 0)); s+=c[i+=1]); s+s=i=0) \\ M. F. Hasler, Nov 14 2021
    
  • Python
    from collections import Counter
    def aupton(nn):
        num, inventory, rowsum, alst = 0, Counter([0]), 0, [0]
        while len(alst) <= nn:
            c = inventory[num]
            num += 1
            rowsum += c
            inventory.update([c])
            if c == 0:
                alst.append(rowsum)
                num = rowsum = 0
        return alst
    print(aupton(52)) # Michael S. Branicky, Nov 14 2021

Extensions

More terms from Alois P. Heinz, Sep 09 2021

A347316 Irregular triangle read by rows: T(n,k) = number of times k appears in n-th row of A342585, n >= 0.

Original entry on oeis.org

1, 1, 2, 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, 0, 0, 4, 1, 2, 1, 0, 1, 2, 1, 1, 2, 0, 2, 0, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 2, 1, 0, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 1, 0, 0, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 2, 0, 0, 2, 0, 2, 1, 1, 1, 2, 1, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Sep 09 2021

Keywords

Examples

			Triangle begins:
1,
1,2,
1,0,3,
1,2,1,1,1,
1,1,0,0,4,
1,2,1,0,1,2,1,
...
Row 4 of A342585 is [4, 4, 4, 1, 4, 0], containing one 0, one 1, and four 4's; so row 4 here is [1, 1, 0, 0, 4].
		

Crossrefs

Cf. A342585, A347299 (row sums).

Programs

  • Mathematica
    Block[{c, k, m, nn = 12}, c[0] = 1; Join[{{1}}, Map[Function[w, {1}~Join~Array[If[ListQ[#], Length[#], 0] &@ Lookup[w, #] &, Max@ Keys[w]]]@ KeySort@ PositionIndex[#] &, SplitBy[Reap[Do[k = 0; While[IntegerQ[c[k]], Set[m, c[k]]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; k++]; Sow[0]; c[0]++, nn]][[-1, -1]], # == 0 &][[1 ;; -1 ;; 2]]]] ] // Flatten (* Michael De Vlieger, Oct 12 2021 *)

Extensions

More terms from Alois P. Heinz, Sep 09 2021

A348966 Variation on the Inventory Sequence A342585: record the number of occurrences of the pair sum of all adjacent terms until 0 is recorded, then restart the count from 0. Start with a(0) = 0. See the Comments.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Nov 05 2021

Keywords

Comments

This sequence is a variation of A342585. Here we record the number of previous occurrences of the pair sum of all adjacent terms until 0 is recorded, after which the pair sum count restarts at 0. For example the terms 0,0,1,1,1 contain one pair that sums to 0 (0,0), one pair that sums to 1 (0,1), and two pairs that sum to 2 (1,1 and 1,1). See the Examples below.
After 20 million terms the largest term is a(19997365) = 512758, which counts the occurrences of pairs that sum to 15, while there are 13766 terms between zeros. It is likely the most common sum increases to arbitrarily large values as n->infinity.

Examples

			a(1) = 0 as there have been no pairs so far in the sequence.
a(2) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(3) = 1 as there has been one pair that sums to 1: a(1) + a(2).
a(4) = 1 as there has been one pair that sums to 2: a(2) + a(3).
a(5) = 0 as there have been no pairs that sum to 3. The count now resets to 0.
a(6) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(7) = 3 as there have been three pairs that sum to 1: a(1) + a(2), a(4) + a(5), a(5) + a(6).
		

Crossrefs

Cf. A342585, A348967 (pair differences), A000045.

Programs

  • Python
    from collections import Counter
    def aupton(terms):
        num, alst, inventory = 0, [0, 0], Counter([0])
        for n in range(2, terms+1):
            c = inventory[num]
            num = 0 if c == 0 else num + 1
            alst.append(c)
            inventory.update([alst[-2] + alst[-1]])
        return alst
    print(aupton(97)) # Michael S. Branicky, Nov 05 2021

A347794 The "Look and Say" version of the Inventory sequence A342585.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Sep 13 2021

Keywords

Comments

This sequences uses the same rules as the Inventory sequence A342585 except here each term is described using the "Look and Say" method of A005150. See the Examples below. Start with a(0) = 0.

Examples

			a(1) = 1 and a(2) = 0, as after a(0) there is "one 0".
a(3) = 1 and a(4) = 1, as after a(0)..a(2) there is "one 1".
a(5) = 0 and a(6) = 2, as after a(0)..a(4) there are "zero 2's". As a number with zero occurrences has appeared, the count resets back to counting zeros.
a(7) = 3 and a(8) = 0, as after a(0)..a(6) there are "three 0's".
a(9) = 3 and a(10) = 1 as after a(0)..a(8) there are "three 1's".
a(11) = 1 and a(12) = 2 as after a(0)..a(10) there is "one 2".
a(13) = 2 and a(14) = 3 as after a(0)..a(12) there are "two 3's".
a(15) = 0 and a(16) = 4 as after a(0)..a(14) there are "zero 4's". As a number with zero occurrences has appeared, the count resets back to counting zeros.
		

Crossrefs

A348218 Variation on the Inventory Sequence A342585: record the number of previous terms which are divisible by the iterating number, starting at 1, until 0 is recorded, then restart the iterating number from 1. See the Comments.

Original entry on oeis.org

1, 1, 0, 2, 1, 0, 4, 2, 0, 6, 4, 1, 2, 0, 10, 7, 1, 2, 1, 1, 1, 0, 17, 8, 1, 3, 1, 1, 1, 1, 0, 25, 9, 3, 3, 2, 1, 1, 1, 1, 1, 0, 35, 10, 5, 3, 5, 1, 2, 1, 1, 2, 0, 45, 13, 7, 3, 7, 1, 4, 1, 2, 2, 0, 55, 16, 8, 6, 8, 2, 4, 4, 2, 2, 1, 0, 66, 26, 10, 9, 9, 3, 4, 4, 4, 3, 2, 0, 77, 32, 14, 13, 9, 3
Offset: 0

Views

Author

Scott R. Shannon, Oct 07 2021

Keywords

Comments

This sequence is a variation of A342585. Instead of iteratively counting the occurrences of each number starting from zero and then repeating when zero is recorded, we start the iterating number at 1 and count the previous terms that are divisible by that number. This number increases for each division until zero previous terms is recorded, when the iterating number is reset to one and the divisor count repeats. The sequence starts with a(0) = 1.
After 10^7 terms the largest value is a(9990262) = 9988674, which is a count of the terms >= 1. The largest value the iterating divisor has reached is 13249.

Examples

			a(1) = 1 as the iterating dividing number starts at 1, and so far there has been one term, a(0), which is divisible by 1.
a(2) = 0 as the dividing number has increased to two, but there have been no terms in the sequence so far that are divisible by 2. The dividing number is now reset to 1.
a(3) = 2 as there have been two terms, a(0) and a(1), that are divisible by 1.
a(4) = 1 as there has been one term, a(3), that is divisible by 2.
a(5) = 0 as there have been no terms divisible by 3. The dividing number is now reset to 1.
		

Crossrefs

A348288 Variation on the Inventory Sequence A342585: the same rules as A342585 are used except that the terms count the occurrences of the iterating number, treated as a string, in the string concatenation of all previous terms. See the Comments.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 10 2021

Keywords

Comments

This is a variation of A342585. The same rules apply except that each number, as it iterates from counting zeros to counting the next number until zero occurrences are found, is treated as a string. The number of occurrences of this string is counted in the concatenation of all previous terms which is also treated as a string. For example when the sequence is adding the number of occurrences of 10, this is treated as the string '10', and thus any occurrence of '10' in the concatenation of all previous terms is counted. This would therefore count the term 1 followed by 0 as an occurrence of '10'. The strings are allowed to overlap, e.g., the number '111' would increment the count of 1's three times, the count of 11's two times, and the count of 111's one time.
Counting the occurrences of each number treated as a string leads to many more terms being found before a zero term is recorded. For example the iteration spanning the 5 millionth term has a(4989084) = 0, a(4989085) = 1059723, then a(5019089) = 2, a(5019090) = 0. Therefore at this stage every number, treated as a string, from 0 to 30005 has occurred at least once in the concatenation of all previous terms.
Unlike A342585 the number of occurrences of the smaller values does not seem to change order as n gets larger. After 5 million terms the order of most frequent occurrences is 1,2,3,4,5,6,7,8,9,0,11,12,10,21,13,14,15,16. It is unlikely the single-digit order changes although, considering that 21 appears high on the count for 2-digit numbers, the order of these and other 2-digit values may change as n gets larger. See the linked image.

Examples

			a(56) = 4. This is the first term that differs from A342585 as in that sequence no 10's have occurred after 55 terms. However in this sequence '10' can be formed by '1' followed by '0', and in the concatenation of terms a(0) to a(55) that has occurred four times, starting as a(2), a(12), a(26), a(35).
		

Crossrefs

Programs

  • Python
    def count_overlaps(subs, s):
        c = i = 0
        while i != -1:
            i = s.find(subs, i)
            if i != -1: c += 1; i += 1
        return c
    def aupton(terms):
        alst, astr, numtocount = [0], "0", 0
        for n in range(2, terms+1):
            c = count_overlaps(str(numtocount), astr)
            numtocount = 0 if c == 0 else numtocount + 1
            alst.append(c)
            astr += str(c)
        return alst
    print(aupton(95)) # Michael S. Branicky, Oct 10 2021

A348781 Partial sums of A342585.

Original entry on oeis.org

0, 1, 2, 2, 4, 6, 8, 8, 11, 13, 17, 18, 19, 19, 23, 27, 31, 32, 36, 36, 41, 46, 50, 51, 57, 59, 60, 60, 66, 73, 78, 79, 85, 88, 91, 92, 92, 99, 108, 113, 116, 122, 126, 130, 132, 132, 140, 149, 155, 159, 168, 172, 177, 179, 180, 183, 183, 192, 202, 209, 214, 224, 230, 236, 239, 240, 244, 246, 246
Offset: 1

Views

Author

N. J. A. Sloane, Nov 13 2021

Keywords

Comments

Needs an estimate for the asymptotic growth rate.

Crossrefs

Cf. A342585.

Programs

  • Python
    def A348781(n):
        k, s, c = 0, 0, dict()
        while True:
            m, r = 0, 1
            while r > 0:
                k += 1
                if k > n:
                    return s
                r = c.get(m,0)
                s += r
                c[r] = c.get(r,0)+1
                m += 1 # Chai Wah Wu, Nov 13 2021

A361287 A variant of the inventory sequence A342585: now a row ends when the number of occurrences of the largest term in the sequence thus far has been recorded.

Original entry on oeis.org

0, 1, 1, 1, 3, 0, 1, 2, 4, 1, 1, 1, 2, 7, 2, 1, 1, 0, 0, 1, 4, 10, 3, 2, 2, 0, 0, 1, 0, 0, 1, 8, 12, 5, 2, 2, 1, 0, 1, 1, 0, 1, 0, 1, 11, 17, 7, 2, 2, 1, 0, 2, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 17, 23, 10, 2, 2, 1, 0, 2, 1, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Robert Dober, Mar 07 2023

Keywords

Examples

			The triangle begins:
  0;
  1, 1;
  1, 3, 0, 1;
  2, 4, 1, 1, 1;
  2, 7, 2, 1, 1, 0, 0, 1;
  4, 10, 3, 2, 2, 0, 0, 1, 0, 0, 1;
  8, 12, 5, 2, 2, 1, 0, 1, 1, 0, 1, 0, 1;
 11, 17, 7, 2, 2, 1, 0, 2, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1;
 17, 23, 10, 2, 2, 1, 0, 2, 1, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1;
...
a(0)=0 because we begin each row by recording the number of zeros in the sequence. As yet, there are none. 0 is still the largest term in the sequence, so we begin the next row.
a(1)=1 because there is one 0. a(2)=1 because there is one 1. 1 is the largest term thus far, so we begin the next row.
a(3)=1 (there is still one zero); a(4)=3 (there are three 1s); a(5)=0 (no 2s); the row ends with a(6)=1 because there is one 3 and three is the largest term thus far.
		

Crossrefs

Programs

  • Mathematica
    len = 84; K = {0}; While[Length@K <= len, i = 0; While[i <= Max@K, AppendTo[K, Count[K, i]]; i++]]; Print[Take[K, len + 1]] (* Samuel Harkness, Mar 12 2023 *)
  • Python
    from collections import Counter
    from itertools import count, islice
    def agen(): # generator of terms
        an, b, m, inventory = 0, 0, 0, Counter([0])
        for n in count(1):
            yield an
            an = inventory[b]
            m = max(m, an)
            b = b + 1 if m > b else 0; inventory.update([an])
    print(list(islice(agen(), 85))) # Michael S. Branicky, Mar 07 2023

Formula

a(n) is the number of all a(k) == b(n) 0 <= k < n and b(0) = 0 and b(n) = b(n-1)+1 if an a(k) > b(n) exists for 0 <= k < n, and 0 otherwise.

Extensions

More terms from Alois P. Heinz, Mar 07 2023

A368509 Irregular triangle read by rows. A variation on the inventory sequence A342585. See Comments and Example sections for details.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 2, 0, 0, 2, 3, 2, 3, 2, 5, 1, 2, 0, 0, 3, 5, 3, 4, 2, 6, 2, 4, 1, 2, 2, 2, 1, 1, 0, 0, 4, 7, 4, 7, 3, 10, 3, 6, 2, 4, 2, 2, 2, 2, 1, 2, 0, 0, 5, 9, 5, 8, 4, 14, 3, 6, 3, 6, 3, 4, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 6, 11, 6, 14, 5, 14, 4, 10, 4, 9, 4, 5
Offset: 1

Views

Author

Tamas Sandor Nagy, Dec 28 2023

Keywords

Comments

Build an irregular triangle in a slightly similar manner to A342585:
Here, record the number of rows containing zeros thus far in the irregular triangle, then the number of columns containing zeros thus far, then the number of rows containing ones thus far, then again the number of columns with ones and so on alternately counts of rows and of columns, until a completed row-column value pair is recorded with either being zero; a new row of the triangle then starts again, recording the number of rows having any zero in them, then the number of columns, and so on. The sequence is the triangle read by rows.

Examples

			The irregular triangle begins:
  0,  1;
  1,  1,  2,  2,  1,  2,  0,  0;
  2,  3,  2,  3,  2,  5,  1,  2,  0,  0;
  3,  5,  3,  4,  2,  6,  2,  4,  1,  2,  2,  2,  1,  1,  0,  0;
  4,  7,  4,  7,  3, 10,  3,  6,  2,  4,  2,  2,  2,  2,  1,  2,  0,  0;
  ...
		

Crossrefs

Cf. A342585.

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        rowinventory, colinventory, thisrow, m = Counter(), dict(), set(), 0
        while True:
            rc = rowinventory[m]
            yield rc
            if rc not in thisrow: rowinventory[rc] += 1; thisrow.add(rc)
            if rc not in colinventory: colinventory[rc] = {2*m}
            else: colinventory[rc].add(2*m)
            cc = len(colinventory.get(m, set()))
            yield cc
            if cc not in thisrow: rowinventory[cc] += 1; thisrow.add(cc)
            if cc not in colinventory: colinventory[cc] = {2*m+1}
            else: colinventory[cc].add(2*m+1)
            if rc == 0 or cc == 0: m = 0; thisrow = set()
            else: m += 1
    print(list(islice(agen(), 90))) # Michael S. Branicky, Dec 28 2023

A356784 Inventory of positions as an irregular table; row 0 contains 0, subsequent rows contain the 0-based positions of 0's, followed by the position of 1's, of 2's, etc. in prior rows flattened.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 01 2022

Keywords

Comments

The n-th row contains A011782(n) terms, and is a permutation of 0..A011782(n)-1.
The leading term of each row is 0, and is followed by powers of 2, and then by positive nonpowers of 2.

Examples

			Table begins:
   0,
   0,
   0, 1,
   0, 1, 2, 3,
   0, 1, 2, 4, 3, 5, 6, 7,
   0, 1, 2, 4, 8, 3, 5, 9, 6, 10, 7, 12, 11, 13, 14, 15,
   ...
For n = 5:
- the terms in rows 0..4 are: 0, 0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 4, 3, 5, 6, 7,
- we have 0's at positions 0, 1, 2, 4, 8,
- we have 1's at positions 3, 5, 9,
- we have 2's at positions 6, 10,
- we have 3's at positions 7, 12,
- we have one 4 at position 11,
- we have one 5 at position 13,
- we have one 6 at position 14,
- we have one 7 at position 15,
- so row 5 is: 0, 1, 2, 4, 8, 3, 5, 9, 6, 10, 7, 12, 11, 13, 14, 15.
		

Crossrefs

Programs

  • Python
    terms = [0,]
    for i in range(1,10):
        new_terms = []
        for j in range(max(terms)+1):
            for k in range(len(terms)):
                if terms[k] == j: new_terms.append(k)
        terms.extend(new_terms)
    print(terms) # Gleb Ivanov, Nov 01 2022

Formula

a(n) = 0 iff n belongs to A131577.
a(n) = 1 iff n belongs to A000051 \ {2}.
a(n) = 2 iff n belongs to A052548 \ {3, 4}.
a(n) = 3 iff n belongs to A005126 \ {2, 4}.
T(n, 0) = 0.
T(n, k) = 2^(k-1) for k = 1..n-1.
Previous Showing 11-20 of 62 results. Next