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 31-40 of 62 results. Next

A347564 Record the number of distinct terms seen thus far, then the number of distinct terms seen only once, then twice, and so on until recording a zero; whereupon repeat the count.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Sep 29 2021

Keywords

Comments

An Inventory sequence counting the occurrences of distinct terms. After every occurrence of a zero term the count of distinct terms seen so far is recorded, then the count of those seen just once, then twice, etc, until a zero term occurs again, whereupon the count is reset. The first reset occurs after a(0), the first zero term. (see A342585, A348016).

Examples

			a(0) must be 0 because at this point no distinct terms have been seen.
Following zero term a(0), we start again, a(1) = 1 since there is only one distinct term in the sequence so far; namely a(0) = 0.
a(2) = 2 because now there are two distinct terms (0,1) each of which have appeared just once.
a(3) = 0 since there are no distinct terms which have appeared twice.
Following zero term a(3) we start again; a(4) = 3, since there are now 3 distinct terms (0,1,2) in the sequence so far.
a(5) = 3 because only three distinct terms (1,2,3) have appeared just once.
a(6) = 2 since there are two terms (0, 3) which have occurred twice.
As an irregular table the sequence starts:
0;
1, 2, 0;
3, 3, 2, 0;
4, 2, 1, 2, 1, 0;
5, 2, 1, 0;
6, 3, 0;
7, 4, 1, 1, 0;
		

Crossrefs

Programs

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

Extensions

a(45) and beyond from Michael S. Branicky, Oct 06 2021

A353092 Inventory sequence counting prime factors. (See comment.)

Original entry on oeis.org

0, 1, 0, 3, 1, 0, 5, 2, 0, 6, 3, 1, 0, 8, 4, 2, 1, 0, 10, 5, 3, 1, 0, 12, 7, 3, 2, 0, 13, 11, 3, 2, 0, 14, 14, 5, 2, 0, 15, 16, 6, 2, 1, 0, 17, 18, 7, 3, 1, 0, 19, 21, 8, 4, 1, 0, 21, 21, 11, 4, 1, 0, 23, 23, 12, 5, 1, 0, 25, 25, 14, 5, 1, 0, 27, 26, 16, 6, 2
Offset: 0

Views

Author

David James Sycamore, Apr 22 2022

Keywords

Comments

0 and 1 are the only nonnegative integers which have no prime factors. The sequence uses this property as follows: Record the number of existing terms which have 0 prime factors, then the number having 1 prime factor, then 2, 3 and so on until reaching a number k such that there are no terms having k prime factors (counted with multiplicity). At this point record a 0 term, and restart the count.

Examples

			a(0) = 0 since at first there are no terms, hence 0 terms with 0 prime factors. The count now restarts because a 0 term has occurred.
a(1) = 1 because now there is one term (a(0)) which has no prime factor.
a(2) = 0 because there is no term with one factor. The count now restarts.
a(3) = 3 because all three prior terms have no prime factor.
a(4) = 1 since a(3) is prime, the first to occur in the sequence.
a(5) = 0 since there are no terms with 2 prime divisors. The count now restarts...
As an irregular table the sequence starts:
   0;
   1, 0;
   3, 1, 0;
   5, 2, 0;
   6, 3, 1, 0;
   8, 4, 2, 1, 0;
  10, 5, 3, 1, 0;
		

Crossrefs

Programs

Extensions

a(50) and beyond from Michael S. Branicky, Apr 22 2022

A357443 Inventory sequence, second version: record where the 1's, 2's, etc. are located starting with a(1) = 1, a(2) = 1.

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Oct 29 2022, edited by N. J. A. Sloane, Nov 07 2022. (Because of a missing term in the initial submission, the definition could be interpreted in two ways: A358066 was the first interpretation, this is the second.)

Keywords

Comments

Essentially the same as A358066, except that at stage k we record where all the numbers from 1 to 2^k have appeared in the sequence in earlier stages. (In A358066 we only look at where the numbers from 1 to k have appeared.)
This means that when the sequence is displayed as a triangle, the row corresponding to stage k >= 1 is a permutation of the numbers from 1 to 2^k.

Examples

			As an irregular triangle, the sequence begins:
1, 1,
1, 2,
1, 2, 3, 4,
1, 2, 3, 5, 4, 6, 7, 8,
1, 2, 3, 5, 9, 4, 6, 10, 7, 11, 8, 13, 12, 14, 15, 16,
1, 2, 3, 5, 9, 17, 4, 6, 10, 18, 7, 11, 19, 8, 13, 22, 12, 20, 14, 23, 15, 25, 16, 27, 21, 24, 26, 29, 28, 30, 31, 32,
...
		

Crossrefs

Formula

a(n) = A356784(n-1) + 1. - Rémy Sigrist, Nov 08 2022

Extensions

More terms from Rémy Sigrist, Nov 08 2022

A358066 Inventory sequence: record where the 1's, 2's, etc. are located starting with a(1) = 1, a(2) = 1 (see example).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 5, 4, 6, 7, 1, 2, 3, 5, 9, 4, 6, 10, 7, 11, 8, 13, 1, 2, 3, 5, 9, 16, 4, 6, 10, 17, 7, 11, 18, 8, 13, 21, 12, 19, 1, 2, 3, 5, 9, 16, 28, 4, 6, 10, 17, 29, 7, 11, 18, 30, 8, 13, 21, 34, 12, 19, 31, 14, 22, 35, 1, 2, 3, 5, 9, 16, 28, 46, 4, 6, 10, 17, 29, 47, 7, 11, 18, 30, 48
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 29 2022

Keywords

Examples

			At stage n >= 1 we only look at the numbers 1 up to n, and ignore numbers bigger than n.
Stage 0: start with a(1) = 1, a(2) = 1.
Stage 1: we see 1's at 1,2, so we adjoin 1,2, getting 1,1, 1,2.
Stage 2: we see 1's at 1,2,3, and 2's at 4, so we adjoin 1,2,3,4, getting 1,1,1,2, 1,2,3,4.
Stage 3: we see 1's at 1,2,3,5, 2's at 4,6 and 3's at 7, so we adjoin 1,2,3,5,4,6,7, getting 1,1,1,2,1,2,3,4, 1,2,3,5,4,6,7.
Stage 4: we see 1's at 1,2,3,5,9, 2's at 4,6,10, 3's at 7,11, 4's at 8,13, so we adjoin 1,2, ..., 8,13 and so on.
We obtain an irregular triangle by writing the results of the stages as separate rows:
1, 1,
1, 2,
1, 2, 3, 4,
1, 2, 3, 5, 4, 6, 7,
1, 2, 3, 5, 9, 4, 6, 10, 7, 11, 8, 13,
1, 2, 3, 5, 9, 16, 4, 6, 10, 17, 7, 11, 18, 8, 13, 21, 12, 19,
1, 2, 3, 5, 9, 16, 28, 4, 6, 10, 17, 29, 7, 11, 18, 30, 8, 13, 21, 34, 12, 19, 31, 14, 22, 35,
... (_N. J. A. Sloane_, Nov 07 2022)
		

Crossrefs

See A357443 for another version.

Programs

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

A358085 Inventory of positions ordered by binary lengths of terms, as an irregular table; the first row contains 1, subsequent rows contains the 1-based positions of terms with binary length 1, followed by positions of terms with binary length 2, 3, etc. in prior rows flattened.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 30 2022

Keywords

Comments

The n-th row contains A011782(n-1) terms, and is a permutation of 1..A011782(n-1).

Examples

			Table begins:
    1,
    1,
    1, 2,
    1, 2, 3, 4,
    1, 2, 3, 5, 4, 6, 7, 8,
    1, 2, 3, 5, 9, 4, 6, 7, 10, 11, 8, 12, 13, 14, 15, 16,
    ...
For n = 6:
- the terms in rows 1..5 are: 1, 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 5, 4, 6, 7, 8,
- terms with binary length 1 are at positions: 1, 2, 3, 5, 9,
- terms with binary length 2 are at positions: 4, 6, 7, 10, 11,
- terms with binary length 3 are at positions: 8, 12, 13, 14, 15,
- terms with binary length 4 are at positions: 16,
- so row 6 is: 1, 2, 3, 5, 9, 4, 6, 7, 10, 11, 8, 12, 13, 14, 15, 16.
		

Crossrefs

Programs

  • PARI
    See Links section.

A358090 Partial inventory of positions as an irregular table; rows 1 and 2 contain 1, for n > 2, row n contains the 1-based positions of 1's, followed by the positions of 2's, 3's, etc. in rows n-2 and n-1 flattened.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 30 2022

Keywords

Comments

This sequence is a variant of A356784; here we consider two prior rows, there all prior rows, hence the term "partial" in the name.
The n-th row contains A000045(n) terms, and is a permutation of 1..A000045(n).

Examples

			Table begins:
    1,
    1,
    1, 2,
    1, 2, 3,
    1, 3, 2, 4, 5,
    1, 4, 2, 6, 3, 5, 7, 8,
    1, 6, 3, 8, 2, 10, 4, 7, 5, 11, 9, 12, 13,
    ...
For n = 7:
- the terms in rows 5 and 6 are: 1, 3, 2, 4, 5, 1, 4, 2, 6, 3, 5, 7, 8,
- positions of 1's are: 1, 6,
- positions of 2's are: 3, 8,
- positions of 3's are: 2, 10,
- positions of 4's are: 4, 7,
- positions of 5's are: 5, 11,
- positions of 6's are: 9,
- positions of 7's are: 12,
- positions of 8's are: 13,
- so row 7 is: 1, 6, 3, 8, 2, 10, 4, 7, 5, 11, 9, 12, 13.
		

Crossrefs

See A358120 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 1.
T(n, 2) = A001611(n-2) for n > 2.

A358120 Partial inventory of positions as an irregular table; rows 1 and 2 contain 1, for n > 2, row n contains the 1-based positions of 1's, followed by the positions of 2's, 3's, etc. in rows n-1 and n-2 flattened.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 30 2022

Keywords

Comments

The n-th row contains A000045(n) terms, and is a permutation of 1..A000045(n).

Examples

			Table begins:
    1,
    1,
    1, 2,
    1, 3, 2,
    1, 4, 3, 5, 2,
    1, 6, 5, 8, 3, 7, 2, 4,
    1, 9, 7, 13, 5, 11, 8, 10, 3, 12, 2, 6, 4,
    ...
For n = 7:
- terms in rows 6 and 5 are: 1, 6, 5, 8, 3, 7, 2, 4, 1, 4, 3, 5, 2,
- positions of 1's are: 1, 9,
- positions of 2's are: 7, 13,
- positions of 3's are: 5, 11,
- positions of 4's are: 8, 10,
- positions of 5's are: 3, 12,
- positions of 6's are: 2,
- positions of 7's are: 6,
- positions of 8's are: 4,
- so row 7 is: 1, 9, 7, 13, 5, 11, 8, 10, 3, 12, 2, 6, 4.
		

Crossrefs

See A358090 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 1.
T(n, 2) = A001611(n-1) for n > 2.

A362746 a(1)=a(2)=1; a(n)=The count of all occurrences in the list so far where integer a(n-1) appears adjacent to integer a(n-2).

Original entry on oeis.org

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

Views

Author

Gavin Lupo, May 01 2023

Keywords

Examples

			a(1) = 1.
a(2) = 1.
a(3) = 2. How many 1's so far are adjacent to a 1? = 2.
a(4) = 1. How many 2's so far are adjacent to a 1? = 1.
a(5) = 2. How many 1's so far are adjacent to a 2? = 2.
a(6) = 2. How many 2's so far are adjacent to a 1? = 2.
		

Crossrefs

Programs

  • Mathematica
    K = {1, 1}; While[Length@K < 87, A = Position[K, Last@K]; c = 0; For[a = 1, a <= Length@A, a++, If[K[[A[[a]] - 1]] == {K[[Length@K - 1]]} || K[[A[[a]] + 1]] == {K[[Length@K - 1]]}, c++]]; AppendTo[K, c]]; Print[K] (* Samuel Harkness, May 08 2023 *)
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        aprev, an, anext, c = 0, 1, 1, Counter({(1, 1)})
        while True:
            aprev, an, anext = an, anext, c[an, anext]
            c[an, anext] += 1
            if aprev != anext: c[anext, an] +=  1
            yield an
    print(list(islice(agen(), 100))) # Michael S. Branicky, May 02 2023

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

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 02 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(3620001) = a(3620002) = a(3620003) = 1159. It is likely such triplets occur infinitely often although this is unknown.

Examples

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

Crossrefs

Cf. A364027 (include previous pair), A342585, A347062.

Programs

A348016 Record the number of terms with no proper divisors, then the number with one proper divisor, then two, three, etc., until reaching a zero term. After each zero term, repeat the count as before.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Sep 24 2021

Keywords

Comments

An inventory sequence counting the proper divisors of existing terms, where zero is taken to have no proper divisors (see A032741). After every occurrence of a zero term the incremental count of terms with 0,1,2,... proper divisors is repeated until another zero term is encountered.

Examples

			a(0) = 0 because at first there are no terms, therefore there are no terms with no proper divisors.
a(1) = 1 because now there is one term (a(0)) which has no proper divisors.
a(2) = 0 since there are no terms with one proper divisor.
a(3) = 3 since there are now three terms having just one proper divisor (0,1,0).
As an irregular triangle the sequence begins:
   0, 1, 0;
   3, 1, 0;
   5, 2, 0;
   6, 3, 0;
   7, 5, 0;
   8, 6, 0;
   9, 6, 4, 1, 0;
  11, 7, 2, 4, 0;
  etc.
		

Crossrefs

Programs

  • PARI
    first(n) = { t = 0; res = vector(n); l = List([1]); for(i = 2, n, for(i = #l + 1, t+1, listput(l, 0) ); res[i] = l[t + 1]; q = if(l[t + 1] == 0, 0, numdiv(l[t + 1]) - 1); for(i = #l + 1, q + 1, listput(l, 0) ); l[q + 1]++; if(res[i] == 0, t = 0 , t++ ) ); res } \\ David A. Corneth, Sep 25 2021
    
  • Python
    from sympy import divisor_count
    from collections import Counter
    def f(n): return 0 if n == 0 else divisor_count(n) - 1
    def aupton(nn):
        num, alst, inventory = 0, [0], Counter([0])
        for n in range(1, nn+1):
            c = inventory[num]
            num = 0 if c == 0 else num + 1
            alst.append(c)
            inventory.update([f(c)])
        return alst
    print(aupton(84)) # Michael S. Branicky, May 07 2023

Extensions

Data corrected and extended by David A. Corneth, Sep 25 2021
Previous Showing 31-40 of 62 results. Next