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-10 of 61 results. Next

A347317 An alternative version of the inventory sequence A342585: now a row only ends when a 0 is reached that would not be followed by any further terms.

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, 1, 0, 9, 10, 6, 4, 9, 4, 5, 2, 0, 3, 1, 0, 11, 11, 7, 5, 10, 6, 6, 3, 0, 3, 2, 2, 0
Offset: 0

Views

Author

N. J. A. Sloane, Sep 09 2021

Keywords

Comments

This sequence has offset 0, which seems more appropriate than the offset 1 that A342585 has.
In both A342585 and the present sequence, a row records the numbers of 0's, 1's, 2's, etc., in the sequence so far.
The difference is that in A342585 a row ends when the first 0 is reached. The row beginning 7, for example, is 7, 9, 5, 3, 6, 4, 4, 2, 0, and ends, because there is no 8 in the sequence up to this point. However, there is a 9, so we can say that the row ended prematurely.
In the present sequence we continue the row until we reach a 0 which is 1 more than the highest term in the sequence up to that point, and then the row ends.
So the row beginning 7 is now 7, 9, 5, 3, 6, 4, 4, 2, 0, 1, 0.
From this point on the two sequences differ.
Unfortunately, this version has the drawback that most of the entries are zero!

Examples

			The triangle begins:
   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,  1,  0;
   9, 10,  6,  4,  9,  4,  5,  2,  0,  3,  1,  0;
  11, 11,  7,  5, 10,  6,  6,  3,  0,  3,  2,  2,  0;
...
		

Crossrefs

Cf. A342585. See A347318 for row lengths.

Programs

  • Mathematica
    Block[{c, k, m, r = 0}, c[0] = 1; {0}~Join~Reap[Do[k = 0; While[k <= r, If[IntegerQ@ c[k], Set[m, c[k]], Set[c[k], 0]; Set[m, 0]]; If[m > r, r = m]; Sow[m]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; k++]; Sow[0]; c[0]++, 9]][[-1, -1]]] (* Michael De Vlieger, Oct 12 2021 *)
  • Python
    from collections import Counter
    def aupton(terms):
        num, alst, inventory = 0, [0], Counter([0])
        for n in range(2, terms+1):
            c = inventory[num]
            if c == 0 and num > max(inventory):
                num = 0
            else:
                num += 1
            alst.append(c); inventory.update([c])
        return alst
    print(aupton(73)) # Michael S. Branicky, Sep 09 2021

A345730 Variation on the Inventory Sequence A342585: record the number of occurrences of previous terms with an incrementing number of given divisors until 0 is recorded, then restart the divisor count from 0. See the Comments.

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, 1, 1, 0, 6, 5, 11, 1, 2, 0, 7, 6, 14, 1, 4, 0, 8, 7, 15, 2, 6, 0, 9, 7, 17, 3, 7, 0, 10, 7, 21, 3, 9, 0, 11, 7, 24, 4, 9, 0, 12, 7, 25, 7, 9, 0, 13, 7, 28, 8, 10, 0, 14, 7, 29, 8, 13, 0, 15, 7, 32, 8, 15, 0, 16, 7, 33, 8, 18, 1, 4
Offset: 0

Views

Author

Scott R. Shannon, Jun 25 2021

Keywords

Comments

This sequence is a variation of A342585. Instead of iteratively counting the occurrences of each number starting from 0 and then repeating when 0 is recorded, we record the number of previous terms with a given number of divisors, where the number of divisors starts at 0 and increments by one until 0 is recorded, after which the divisor count restarts at 0. It is assumed 0 has zero divisors while the number of divisors for all other numbers is given by A000005. See the Examples below.
After 10 million terms, numbers with four, eight and two divisors are the most common, and in general terms with an even number of divisors are more common than those with an odd number. However like A342585 the graph of the sequence shows that the number of terms with a given number of divisors increases somewhat haphazardly and thus it is unclear if terms with four divisors stay the most numerous as n -> infinity.
Alternative definition: Record the number of existing terms which are divisible by any m > 0, then record the number of terms having 1 divisor, then 2, 3 and so on until a zero is recorded. Repeat the process indefinitely. - David James Sycamore, Sep 25 2021

Examples

			The sequence begins 0, 1, 1, 0, 2, 2, 2, 0. After the initial 0, a(1) counts the terms with 0 divisors (i.e., the 0's), which is 1. a(2) then counts the terms with one divisor (i.e., the 1's), which is 1, and a(3) counts the terms with two divisors (i.e., the primes), which is 0. So the divisor count then resets to 0 and a(4) counts the terms with 0 divisors, which is 2. a(5) counts the terms with one divisor, which is 2, and a(6) counts the terms with two divisors, which is 2. There are no terms with three divisors so a(7) = 0 and the divisor count then resets to 0.
		

Crossrefs

A355916 Variant of Inventory Sequence A342585 where indices are also counted (long version).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 24 2022

Keywords

Comments

Similar to A342585, except that when we take inventory, we write down what we are counting as a subscript on the count. So if we have found k copies of m so far, we write down k_m, and include both the k and m values when we next take inventory.
More than the usual number of terms are shown, in order to match A355917.

Examples

			Initially we have no 0's, so the first inventory is 0_0. Just as in A342585, when we reach a count of zero, we take a new inventory.
Now we see two 0's, so we write down 2_0, followed by 0_1, since there are no 1's.
So the first two inventories are
  0_0,
  2_0, 0_1.
Now we see four 0's, so the next inventory starts 4_0, then 1_1, 1_2, and 0_3:
  4_0, 1_1, 1_2, 0_3.
The first eight inventories are:
  0_0,
  2_0, 0_1,
  4_0, 1_1, 1_2, 0_3,
  6_0, 4_1, 2_2, 1_3, 2_4, 0_5,
  8_0, 6_1, 5_2, 2_3, 3_4, 2_5, 2_6, 0_7,
  10_0, 7_1, 9_2, 4_3, 5_4, 4_5, 3_6, 2_7, 1_8, 1_9, 1_10, 0_11,
  12_0, 11_1, 11_2, 6_3, 7_4, 5_5, 5_6, 4_7, 2_8, 2_9, 2_10, 3_11, 1_12, 0_13,
  14_0, 13_1, 15_2, 8_3, 9_4, 8_5, 6_6, 5_7, 5_8, 4_9, 3_10, 4_11, 2_12, 2_13, 1_14, 1_15, 0_16,
...
The sequence is obtained by reading the inventories, with each count followed by its index: 0, 0, 2, 0, 0, 1, 4, 0, 1, 1, 1, 2, 0, 3, ...
If the indices are omitted, we get the short version, A355917. A355918 lists the highest index in each inventory.
		

Crossrefs

Programs

A355917 Variant of Inventory Sequence A342585 where indices are also counted (short version).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 24 2022

Keywords

Comments

See A355916 for further information.

Examples

			The first eight inventories are:
  0,
  2, 0,
  4, 1, 1, 0,
  6, 4, 2, 1, 2, 0,
  8, 6, 5, 2, 3, 2, 2, 0,
  10, 7, 9, 4, 5, 4, 3, 2, 1, 1, 1, 0,
  12, 11, 11, 6, 7, 5, 5, 4, 2, 2, 2, 3, 1, 0,
  14, 13, 15, 8, 9, 8, 6, 5, 5, 4, 3, 4, 2, 2, 1, 1, 0,
  ...
		

Crossrefs

Programs

Extensions

More terms from Rémy Sigrist, Sep 25 2022

A343880 Positions of 0's in A342585.

Original entry on oeis.org

1, 4, 8, 14, 20, 28, 37, 46, 57, 69, 82, 95, 110, 125, 142, 159, 177, 196, 216, 238, 260, 285, 310, 335, 362, 390, 418, 448, 478, 511, 544, 578, 613, 648, 685, 722, 761, 800, 842, 884, 927, 971, 1018, 1065, 1112, 1161, 1210, 1259, 1309, 1361, 1413, 1467, 1521
Offset: 1

Views

Author

Rémy Sigrist, May 02 2021

Keywords

Comments

This sequence is infinite.

Examples

			A342585(8) = 0, so 8 belongs to the sequence.
		

Crossrefs

Cf. A342585.

Programs

  • Mathematica
    Position[Block[{c, k, m}, c[0] = 1; {0}~Join~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]++, 52]][[-1, -1]]], 0][[All, 1]] (* Michael De Vlieger, Oct 12 2021 *)
  • PARI
    See Links section.
    
  • Python
    from collections import Counter
    def aupton(terms):
        num, A342585lst, inventory, alst, idx = 0, [0], Counter([0]), [1], 1
        while len(alst) < terms:
            idx += 1
            c = inventory[num]
            if c == 0:
                num = 0
                alst.append(idx)
            else:
                num += 1
            A342585lst.append(c)
            inventory.update([c])
        return alst
    print(aupton(53)) # Michael S. Branicky, Oct 12 2021

A343878 a(n) is the least k such that A342585(k) = n.

Original entry on oeis.org

1, 2, 5, 9, 11, 21, 25, 30, 47, 39, 59, 71, 96, 100, 126, 115, 160, 178, 197, 217, 221, 261, 243, 265, 336, 322, 374, 419, 397, 479, 425, 485, 551, 583, 649, 618, 723, 653, 801, 690, 727, 887, 930, 974, 889, 932, 1115, 976, 1260, 1310, 1023, 1414, 1070, 1522
Offset: 0

Views

Author

Rémy Sigrist, May 02 2021

Keywords

Comments

The term after the n-th 0 in A342585 is the running total of 0's, and there are infinitely many 0's, so all nonnegative integers appear in A342585. - Peter Munn, May 08 2021

Examples

			We have:
n:       1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
A342585: 0, 1, 1, 0, 2, 2, 2, 0, 3, 2,  4,  1,  1,  0,  4,  4,  4,  1,  4,  0,  5
So:
- a(0) = 1, a(1) = 2, a(2) = 5, a(3) = 9, a(4) = 11, a(5) = 21.
		

Crossrefs

For records see A347305.

Programs

  • Mathematica
    Block[{a, c, k, m, nn = 54}, c[0] = 1; a = {0}~Join~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]]; TakeWhile[Array[FirstPosition[a, #][[1]] &, nn, 0], IntegerQ]] (* Michael De Vlieger, Oct 12 2021 *)
  • PARI
    See Links section.
    
  • Python
    def A343878(n):
        k, c = 0, dict()
        while True:
            m, r = 0, 1
            while r > 0:
                k += 1
                r = c.get(m,0)
                if n == r:
                    return k
                c[r] = c.get(r,0)+1
                m += 1 # Chai Wah Wu, Aug 31 2021

Formula

For n >= 1, a(n) <= A343880(n) + 1. - Peter Munn, May 08 2021

Extensions

Name shortened by Peter Munn, May 08 2021

A347299 Lengths of successive rows when the Inventory Sequence A342585 is written as a triangle.

Original entry on oeis.org

1, 3, 4, 6, 6, 8, 9, 9, 11, 12, 13, 13, 15, 15, 17, 17, 18, 19, 20, 22, 22, 25, 25, 25, 27, 28, 28, 30, 30, 33, 33, 34, 35, 35, 37, 37, 39, 39, 42, 42, 43, 44, 47, 47, 47, 49, 49, 49, 50, 52, 52, 54, 54
Offset: 1

Views

Author

N. J. A. Sloane, Aug 27 2021

Keywords

Comments

First differences of A343880, preceded by 1.

Crossrefs

Programs

A347305 Indices of records in A342585.

Original entry on oeis.org

1, 2, 5, 9, 11, 21, 25, 30, 39, 59, 71, 96, 100, 115, 160, 178, 197, 217, 221, 243, 265, 322, 374, 397, 425, 485, 551, 583, 618, 653, 690, 727, 887, 889, 932, 976, 1023, 1070, 1117, 1166, 1215, 1264, 1314, 1418, 1588, 1650, 1712, 1774, 1836, 1898, 1960, 2024, 2088
Offset: 1

Views

Author

N. J. A. Sloane, Aug 31 2021

Keywords

Crossrefs

Cf. A342585, A343878, A348782 (the records).

Programs

Extensions

Definition corrected by N. J. A. Sloane, Nov 13 2021
b-file corrected by Michael De Vlieger, Nov 13 2021

A348782 Records in A342585.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 25, 26, 28, 30, 31, 32, 33, 35, 37, 39, 40, 41, 44, 45, 47, 50, 52, 55, 56, 57, 58, 59, 60, 62, 64, 67, 69, 70, 71, 72, 73, 74, 75, 76, 79, 81, 83, 84, 85, 86, 87, 90, 94, 96, 98, 99, 100, 101, 102, 103, 105, 109, 119, 129
Offset: 1

Views

Author

N. J. A. Sloane, Nov 13 2021

Keywords

Comments

Although initially this contains most numbers, eventually the terms become sparse.
It would be nice to have an estimate for the upper envelope of the Inventory Sequence A342585 (that is, for a curve through the points with coordinates (A347305(n), a(n))).

Crossrefs

Cf. A342585, A347305 (indices).

Programs

A348967 Variation on the Inventory Sequence A342585: record the number of occurrences of the pair difference 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, 0, 2, 2, 1, 0, 3, 4, 1, 2, 0, 3, 6, 2, 4, 1, 0, 3, 7, 3, 6, 3, 0, 3, 7, 3, 10, 5, 1, 0, 3, 8, 3, 11, 6, 4, 0, 3, 8, 4, 12, 8, 5, 0, 3, 8, 4, 14, 10, 7, 0, 3, 8, 4, 16, 12, 8, 0, 3, 8, 4, 17, 15, 9, 1, 2, 4, 0, 3, 9, 6, 19, 16, 9, 2, 4, 4, 0, 4, 9, 7, 20, 18, 10, 2, 4, 6, 0, 4, 9, 11
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 differences of all adjacent terms until 0 is recorded, after which the pair difference count restarts at 0. For example the terms 0,0,2,1,3 contain one pair with a difference of 0 (0,0), one pair with a difference of 1 (2,1), and two pairs with a difference of 2 (0,2 and 1,3). See the Examples below.
After 20 million terms the largest term is a(19995157) = 2537781, which counts the occurrences of pairs with a difference of 1, while there are 5725 terms between zeros. It is likely the most common pair difference remains at 1 as n increases although this is unknown.

Examples

			a(1) = 0 as there have been no pairs so far in the sequence.
a(2) = 1 as there has been one pair with a difference of 0: |a(1) - a(0)|.
a(3) = 1 as there has been one pair with a difference of 1: |a(2) - a(1)|.
a(4) = 0 as there has been no pairs with a difference of 2. The count now resets to 0.
a(5) = 2 as there has been two pairs with a difference of 0: |a(1) - a(0)|, |a(3) - a(2)|.
a(6) = 2 as there has been two pairs with a difference of 1: |a(2) - a(1)|, |a(4) - a(3)|.
a(7) = 1 as there has been one pair with a difference of 2: |a(5) - a(4)|.
		

Crossrefs

Cf. A342585, A348966 (pair sums).

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([abs(alst[-2] - alst[-1])])
        return alst
    print(aupton(93)) # Michael S. Branicky, Nov 05 2021
Showing 1-10 of 61 results. Next