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 21-30 of 62 results. Next

A347738 A variant of the inventory sequence: record the number of terms >= 0 thus far in the sequence, then the number of terms >= 1 thus far, then the number of terms >= 2 thus far, and so on, until a zero is recorded; the inventory then starts again, recording the number of terms >= 0, etc.

Original entry on oeis.org

0, 1, 1, 0, 4, 3, 2, 2, 1, 0, 10, 8, 6, 5, 5, 5, 3, 2, 2, 1, 1, 0, 22, 19, 15, 12, 11, 11, 9, 9, 10, 10, 9, 6, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 0, 46, 42, 35, 28, 24, 23, 21, 20, 21, 21, 19, 17, 16, 16, 17, 18, 18, 17, 15, 13, 11, 10, 7, 6, 5, 4, 4, 4, 4, 3, 3
Offset: 0

Views

Author

David James Sycamore, Sep 12 2021

Keywords

Comments

Sequence starts off as A342585 but diverges after a(4). The effect is to introduce some numbers earlier in this sequence than in the original, and to stretch out the incidences of zero terms by the fact that the term immediately following a zero is now the total number of prior terms, rather than the total number of prior zero terms.
In A342585 zeros occur at positions 1,4,8,14,20,28,... (see A343880) whereas in this version they occur at positions 1,4,10,22,46,... (which is A033484, as is easily proved by induction).

Examples

			As an irregular triangle this begins:
   0;
   1,  1,  0;
   4,  3,  2,  2,  1,  0;
  10,  8,  6,  5,  5,  5, 3, 2,  2,  1, 1, 0;
  22, 19, 15, 12, 11, 11, 9, 9, 10, 10, 9, 6, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 0;
  46, ...
(for row lengths see A003945)
		

Crossrefs

Cf: A342585, A033484, A003945, A343880, A003945 (row lengths), A347324 (row sums).
A347326 has a version of this in which the rows have been normalized.

Programs

  • Mathematica
    a[n_] := a[n] = Block[{t}, t = If[a[n - 1] == 0, 0, b[n - 1] + 1]; b[n] = t; Sum[If[a[j] >= t, 1, 0], {j, n - 1}]]; b[1] = a[1] = 0; Array[a, 77] (* Michael De Vlieger, Sep 12 2021, after Jean-François Alcover at A342585 *)
  • Python
    def aupton(nn):
        num, gte_inventory, alst, bigc = 0, [1], [0], 0
        while len(alst) < nn+1:
            c = gte_inventory[num] if num <= bigc else 0
            num = 0 if c == 0 else num + 1
            for i in range(min(c, bigc)+1):
                gte_inventory[i] += 1
            for i in range(bigc+1, c+1):
                gte_inventory.append(1)
            bigc = len(gte_inventory) - 1
            alst.append(c)
        return alst
    print(aupton(76)) # Michael S. Branicky, Sep 19 2021

Extensions

Offset changed to 0 by N. J. A. Sloane, Sep 12 2021

A032531 An inventory sequence: triangle read by rows, where T(n, k), 0 <= k <= n, records the number of k's thus far in the flattened sequence.

Original entry on oeis.org

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

Views

Author

Dmitri Papichev (Dmitri.Papichev(AT)iname.com)

Keywords

Comments

Old name: a(n) = number of a(i) for 0<=iA002262(n).
This sequence is a variation of the Inventory sequence A342585. The same rules apply except that in this variation each row ends after k terms, where k is the current row count which starts at 1. The behavior up to the first 1 million terms is similar to A342585 but beyond that the most common terms do not increase, likely due to the rows being cut off after k terms thus numbers such as 1 and 2 no longer make regular appearances. Larger number terms do increase and overtake the leading early terms, and it appears this pattern repeats as n increases. See the linked images. - Scott R. Shannon, Sep 13 2021
The complexity of this sequence derives from the totals being updated during the calculation of each row. If each row recorded an inventory of only the earlier rows, we would get the much simpler A025581. - Peter Munn, May 06 2023

Examples

			Triangle begins:
  0;
  1, 1;
  1, 3, 0;
  2, 3, 1, 2;
  2, 4, 3, 3, 1;
  2, 5, 4, 4, 3, 1;
  2, 6, 5, 5, 3, 3, 1;
  2, 7, 6, 7, 3, 3, 2, 2;
  2, 7, 9, 9, 3, 3, 2, 3, 0;
  ...
		

Crossrefs

Programs

  • Maple
    A002262 := proc(n)
        n - binomial(floor(1/2+sqrt(2*(1+n))), 2);
    end proc:
    A032531 := proc(n)
        option remember;
        local a,piv,i ;
        a := 0 ;
        piv := A002262(n) ;
        for i from 0 to n-1  do
            if procname(i) = piv then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A032531(n),n=0..100) ; # R. J. Mathar, May 08 2020
  • Mathematica
    A002262[n_] :=  n - Binomial[Floor[1/2 + Sqrt[2*(1 + n)]], 2];
    A032531[n_] := A032531[n] = Module[{a, piv, i}, a = 0; piv = A002262[n]; For[i = 0, i <= n-1, i++, If[A032531[i] == piv, a++]]; a];
    Table[A032531[n], {n, 0, 100}] (* Jean-François Alcover, Mar 25 2024, after R. J. Mathar *)
  • Python
    from math import comb, isqrt
    from collections import Counter
    def idx(n): return n - comb((1+isqrt(8+8*n))//2, 2)
    def aupton(nn):
        num, alst, inventory = 0, [0], Counter([0])
        for n in range(1, nn+1):
            c = inventory[idx(n)]
            alst.append(c)
            inventory[c] += 1
        return alst
    print(aupton(93)) # Michael S. Branicky, May 07 2023

Extensions

New name from Peter Munn, May 06 2023

A354606 a(1) = 1; for n > 1, a(n) is number of terms in the first n-1 terms of the sequence that have the same number of divisors as a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 08 2022

Keywords

Comments

After 250000 terms the most common number of divisors of all terms are 4, 8, 2, 12, 16 divisors. These correspond to the uppermost five lines of the attached image. It is unknown if these stay the most common or are passed by numbers with more divisors as n gets arbitrarily large.
See A355606 for the indices where a(n) = 1.

Examples

			a(6) = 2 as a(5) = 3 which has two divisors, and the total number of terms in the first five terms with two divisors is two, namely a(3) = 2 and a(5) = 3.
		

Crossrefs

Programs

A356348 a(0) = 0; for n > 0, a(n) is the number of preceding terms having the same digit sum as a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 15 2022

Keywords

Examples

			a(21) = 2 as a(20) = 11 which has a digit sum of 2, and there has been two previous terms with a digit sum of two: a(3) = 2 and a(20) = 11.
		

Crossrefs

Cf. A007953, A137671 (base 2), A342585.

Programs

A347062 Record the number of zero terms having a following term, then the number of terms equal to 1 having a following term, then 2, 3, etc. until recording a zero, whereupon the count is reset.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Oct 16 2021

Keywords

Comments

Inventory sequence recording the number of existing terms immediately following occurrences of a zero term, then the number immediately following occurrences of 1, then 2, and so on until another zero is recorded, after which the count is reset. Inclusion of a term in any count requires it to have been followed by another term first, therefore lead terms are not included in the current count.
The scatterplot exhibits trajectories attributable to the register of occurrences of the immediately-preceding term m, c(m), and irregular periodicity of nondecreasing length. - Michael De Vlieger, Oct 16 2021
Suggested by A342585.

Examples

			At first there are no terms, thus none following a zero, so a(0) = 0.
After a(0) = 0 the count is reset, and since there are still no terms following a zero, a(1) = 0. The count is now reset again and we have one term a(1) = 0 which follows a zero term, so a(2) = 1.
We now have 0,0,1 and because no term yet follows 1, a(3) must be 0 (the lead term here is 1 but it is not counted).
The count is now reset and there are two terms (a(1) and a(2)) which follow a zero term, thus a(4) = 2; etc.
As an irregular triangle the sequence begins:
0;
0;
1, 0;
2, 1, 1, 0;
3, 3, 1, 2, 0;
4, 4, 2, 2, 2, 0;
5, 4, 5, 2, 3, 2, 0;
6, 4, 7, 3, 4, 2, 1, 1, 0;
...
		

Crossrefs

Programs

  • Mathematica
    Block[{c, k, m, n}, c[0] = 1; m = 0; {0, 0}~Join~Reap[Do[k = 0; While[IntegerQ[c[k]], Set[n, c[k]]; Sow[n]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; Set[m, n]; k++]; Sow[0]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; Set[m, 0], 11]][[-1, -1]]] (* Michael De Vlieger, Oct 16 2021 *)

A347791 Inventory sequence using prime divisors (with multiplicity): Record the number of terms thus far which are divisible by every prime, then the number of terms thus far not divisible by any prime, then the number divisible (once) by a single prime, then 2 (including with multiplicity), then 3 etc until a zero is recorded. Repeat after every zero term.

Original entry on oeis.org

0, 1, 1, 0, 2, 2, 2, 0, 3, 2, 5, 0, 4, 2, 7, 1, 0, 5, 3, 10, 2, 0, 6, 3, 12, 3, 1, 0, 7, 4, 14, 5, 1, 0, 8, 5, 16, 5, 2, 1, 0, 9, 6, 18, 7, 3, 1, 0, 10, 7, 21, 9, 3, 1, 0, 11, 8, 23, 10, 4, 1, 0, 12, 9, 24, 13, 5, 2, 0, 13, 9, 28, 14, 6, 2, 0, 14, 9, 29, 18, 7
Offset: 0

Views

Author

David James Sycamore, Sep 13 2021

Keywords

Comments

Inspired by the original Inventory sequence (A342585). It follows from the definition that zero appears infinitely many times. Every nonzero number number appears because the number of zero terms increments at every extension of the sequence between consecutive zeros. Since the count for each number of divisors increments (eventually) as the sequence extends, it follows that every number appears infinitely many times.
The count of terms divisible by every prime is the number of zeros, the count of terms divisible by no prime is the number of 1s, the count of terms divisible by one prime (once) is the number of primes, etc.

Examples

			a(0)=0 because at this point there are zero terms divisible by every prime. a(1)=1 because there is now one term (0) which is divisible by every prime. a(2)=1 because there is now one term (1) with no prime divisor. a(3)=0 because at this point there is no term divisible by one prime, and so on.
As an irregular triangle the sequence begins:
   0;
   1,  1,  0;
   2,  2,  2,  0;
   3,  2,  5,  0;
   4,  2,  7,  1,  0;
   5,  3, 10,  2,  0;
   6,  3, 12,  3,  1,  0;
   7,  4, 14,  5,  1,  0;
   8,  5, 16,  5,  2,  1,  0;
   9,  6, 18,  7,  3,  1,  0;
  10,  7, 21,  9,  3,  1,  0;
  11,  8, 23, 10,  4,  1,  0; etc.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {}, c, k, m}, c[-1] = 0; Do[k = -1; c[-1]++; AppendTo[a, 0]; While[IntegerQ[c[k]], AppendTo[a, c[k]]; Set[m, PrimeOmega[c[k]]]; If[IntegerQ[c[m]], c[m]++, Set[c[m], 1]]; k++], 10]; a] (* Michael De Vlieger, Sep 15 2021 *)

A357317 Inventory count sequence: record what you see and where it is located.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Sep 29 2022

Keywords

Comments

To get started we set a(0)=0. Now start with zero terms. We record ONE ZERO at position ZERO. The sequence is now 0,1,0,0. Now start again with zero terms. We record THREE ZEROS at positions 0,2,3. Next start with one terms. We record ONE ONE at position ONE. The sequence is now 0,1,0,0,3,0,0,2,3,1,1,1. Now start again with zero terms...one terms...two terms...three terms. The sequence is now 0,1,...,2,3,4,8. And so on.

Examples

			a(0) = 0
counting over a(0):
a(1) = 1, a(2) = 0, a(3) = 0  (count one zero at position 0)
counting over a(0)..a(3):
a(4) = 3, a(5) = 0, a(6) = 0, a(7) = 2, a(8) = 3, (count 3 zeros at positions 0,2,3)
a(9) = 1, a(10) = 1, a(11) = 1 (count 1 one at position 1)
counting over a(0)..a(11):
a(12) = 5, a(13) = 0, a(14) = 0, a(15) = 2, a(16) = 3, a(17) = 5, a(18) = 6 (count 5 zeros at positions 0,2,3,5,6)
a(19) = 4, a(20) = 1, a(21) = 1, a(22) = 9, a(23) = 10, a(24) = 11 (count 4 ones at positions 1,9,10,11)
a(25) = 1, a(26) = 2, a(27) = 7 (count 1 two at position 7)
a(28) = 2, a(29) = 3, a(30) = 4, a(31) = 8 (count 2 threes at positions 4,8)
counting over a(0)..a(31):
etc.
		

Crossrefs

Cf. A342585.

Programs

  • MATLAB
    function a = A357317( min_length )
        a = 0;
        while length(a) < min_length
            b = a; c = unique(a);
            for m = 1:length(c)
                nextnumber = c(m);
                indices = find(a == nextnumber);
                b = [b length(indices) nextnumber indices-1];
            end
            a = b;
        end
    end % Thomas Scheuerle, Sep 29 2022

A362031 a(1) = 1; for n > 1, a(n) is number of terms in the first n-1 terms of the sequence that have the same number of prime factors, counted with multiplicity, as a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 06 2023

Keywords

Comments

After 1 million terms the most common numbers for the number of prime factors of the terms are 3, 2, 4, and 5. These correspond to the uppermost four lines of the attached image. It is unknown if these stay the most common or are passed by numbers with more prime factor as n gets arbitrarily large.
See A362033 for the indices where a(n) = 1.

Examples

			a(6) = 2 as the number of prime factors of a(5) = A001222(a(5)) = A001222(3) = 1, and there are two previous terms, a(3) and a(5), that have one prime factor.
a(9) = 1 as the number of prime factors of a(8) = A001222(a(8)) = A001222(4) = 2, and there is only one term, a(8), that has two prime factors.
		

Crossrefs

Programs

A174382 T(1,0)=0 and for n > 1, T(n,k) is the number of k's in rows 1 to n - 1.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 4, 0, 1, 2, 6, 0, 1, 1, 3, 8, 1, 1, 1, 0, 1, 4, 12, 1, 2, 1, 0, 1, 0, 1, 6, 16, 2, 2, 2, 0, 1, 0, 1, 0, 0, 0, 1, 11, 19, 5, 2, 2, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 19, 22, 8, 2, 2, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 27, 28, 11, 2, 2, 1, 2, 0, 2, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 1
Offset: 1

Views

Author

Keywords

Comments

Construction as in A333867 but starting with a 0 and including a count of 0s at the start of each row. [Edited by Peter Munn, Oct 11 2022]
See A342585 for a similarly defined sequence that has been analyzed more and has lists of other related sequences. - Peter Munn, Oct 08 2022

Examples

			0;
1; # one zero
1,1; # one zero, one one
1,3; # one zero, three ones
1,4,0,1; # one zero, four ones, zero twos, one three
		

Crossrefs

Cf. A240508 (row lengths).

Programs

  • Haskell
    import Data.List (sort, group)
    a174382 n k = a174382_tabf !! (n-1) !! k
    a174382_row n = a174382_tabf !! (n-1)
    a174382_tabf = iterate f [0] where
       f xs = g (xs ++ [0, 0 ..]) [0..] (map head zs) (map length zs)
         where g   _ [] = []
               g (u:us) (k:ks) hs'@(h:hs) vs'@(v:vs)
                 | k == h = u + v : g us ks hs vs
                 | k /= h = u : g us ks hs' vs'
               zs = group $ sort xs
    -- Reinhard Zumkeller, Apr 06 2014
  • Maple
    b:= proc(n) option remember; `if`(n<1, 0, b(n-1)+add(x^i, i=T(n))) end:
    T:= proc(n) option remember; `if`(n=1, 0, (p->
          seq(coeff(p, x, i), i=0..degree(p)))(b(n-1)))
        end:
    seq(T(n), n=1..12);  # Alois P. Heinz, Aug 25 2025

A364027 a(0) = 0, a(1) = 0; for n > 1, a(n) is the number of pairs of consecutive terms that sum to the same value as a(n-2) + a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 01 2023

Keywords

Comments

The same number cannot occur four times in a row as the second pair in a triplet of the same numbers increments the appearance count of the first pair by one, so the fourth number is always one more than the previous three numbers.
The occurrences of three consecutive equal numbers is quite rare, only occurring thirteen times in the first 20 million terms. The last such triplet is a(3641208) = a(3641209) = a(3641210) = 1177. It is likely such triplets occur infinitely often although this is unknown.

Examples

			a(2) = 1 as there is one pair that sums to a(0) + a(1) = 0, namely a(0) + a(1).
a(4) = 1 as a(2) + a(3) = 1 + 1 = 2, and there has been one previous pair that also sums to 2, namely a(2) + a(3).
a(5) = 2 as a(3) + a(4) = 1 + 1 = 2, and there has been two previous pairs that also sums to 2, namely a(2) + a(3) and a(3) + a(4).
		

Crossrefs

Cf. A306251, A364036 (do not include previous pair), A342585, A347062.

Programs

Formula

a(n) = A306251(n-2) for any n >= 3. - Rémy Sigrist, Apr 03 2025
Previous Showing 21-30 of 62 results. Next