A347326
A347738 with rows normalized by subtracting each term in a row from the first term in the row.
Original entry on oeis.org
0, 0, 0, 1, 0, 1, 2, 2, 3, 4, 0, 2, 4, 5, 5, 5, 7, 8, 8, 9, 9, 10, 0, 3, 7, 10, 11, 11, 13, 13, 12, 12, 13, 16, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 0, 4, 11, 18, 22, 23, 25, 26, 25, 25, 27, 29, 30, 30, 29, 28, 28, 29, 31, 33, 35, 36, 39, 40, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46
Offset: 0
Row 2 of A347738 is [4,3,2,2,1,0], and subtracting each term from the first term, 4, we get row 2 of the present sequence, [0, 1, 2, 2, 3, 4].
The first few normalized rows are:
[0],
[0, 0, 1],
[0, 1, 2, 2, 3, 4],
[0, 2, 4, 5, 5, 5, 7, 8, 8, 9, 9, 10],
[0, 3, 7, 10, 11, 11, 13, 13, 12, 12, 13, 16, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22],
[0, 4, 11, 18, 22, 23, 25, 26, 25, 25, 27, 29, 30, 30, 29, 28, 28, 29, 31, 33, 35, 36, 39, 40, 41, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 46],
...
-
def aupton(nn):
num, gte_inventory, bigc, row, alst = 0, [1], 0, [], [0]
while len(alst) < nn + 1:
c = gte_inventory[num] if num <= bigc else 0
row.append(c)
num += 1
if c == 0:
num = 0
alst.extend([row[0] - row[i] for i in range(len(row))])
row = []
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
return alst
print(aupton(92)) # Michael S. Branicky, Sep 19 2021
A347324
Row sums in A347738 when that sequence is written as a triangle.
Original entry on oeis.org
0, 2, 12, 48, 167, 541, 1692, 5187, 15700, 47030, 139986, 415385, 1230417, 3638657, 10744058, 31705658, 93563017, 276079102, 814408697, 2402076923, 7085491321, 20902994644, 61668276920, 181926014930, 536710980085, 1583529043750, 4672393755494, 13786612213841
Offset: 0
Row 2 is 4, 3, 2, 2, 1, 0, which has sum 12.
-
Total /@ TakeList[Import["https://oeis.org/A347738/b347738.txt", "Data"][[All, -1]], {1}~Join~Array[3*2^# &, 13, 0]] (* Michael De Vlieger, Sep 13 2021, generated using the b-file at A347738 *)
-
def afind():
num, gte_inventory, rowsum, bigc = 0, [1], 0, 0
print(0, end=", ")
while True:
c = gte_inventory[num] if num <= bigc else 0
num += 1
rowsum += c
if c == 0:
print(rowsum, end=", ")
num = rowsum = 0
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
afind() # Michael S. Branicky, Sep 19 2021
A342585
Inventory sequence: record the number of zeros thus far in the sequence, then the number of ones thus far, then the number of twos thus far and so on, until a zero is recorded; the inventory then starts again, recording the number of zeros.
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, 0, 9, 10, 7, 5, 10, 6, 6, 3, 1, 4, 2, 0, 10, 11, 8, 6, 11, 6, 9, 3, 2, 5, 3, 2, 0, 11, 11, 10
Offset: 1
As an irregular triangle this 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;
8, 9, 6, 4, 9, 4, 5, 2, 1, 3, 0;
9, 10, 7, 5, 10, 6, 6, 3, 1, 4, 2, 0;
10, 11, 8, 6, 11, 6, 9, 3, 2, 5, 3, 2, 0;
...
For row lengths see A347299. - _N. J. A. Sloane_, Aug 27 2021
From _David James Sycamore_, Oct 18 2021: (Start)
a(1) is 0 because the count is reset, and as yet there is no zero term immediately following another term. a(2) = 1 since the count is reset, a(1) = 0 and a(0) precedes it. The count now increments to terms equal to 1.
a(3) = 1 since a(2) = 1 and a(1) precedes it. a(4) = 0 because there is no term equal to 2 which is immediately preceded by another term.
a(5) = 2 since the count is reset, a(1) = a(4) = 0 and a(0), a(3) respectively, precede them. (End)
- Rémy Sigrist, Table of n, a(n) for n = 1..25000
- Brady Haran and N. J. A. Sloane, "A Number Sequence with Everything" (the Inventory Sequence A342585), Numberphile video, November 2022.
- Hans Havermann, Colored plot of 1000467 terms [See Comments for a description of this plot]
- Hugo Pfoertner, Listening to the first 100000 terms of A342585, YouTube video from "Talabfahrer".
- Hugo Pfoertner, Hear 1 million terms of A342585, YouTube video from "Talabfahrer", alternative audio conversion.
- Luc Rousseau, AWK program for A342585
- Rémy Sigrist, Scatterplot of the first 10^6 terms
- Rémy Sigrist, Scatterplot of the first 10^7 terms
- Rémy Sigrist, Scatterplot of the first 10^8 terms
- Rémy Sigrist, Table of n, a(n) for n = 1..100000
- Rémy Sigrist, PARI program for A342585
- Jan Ritsema van Eck, Graph #1: 1000 terms (blue) and inverse triangular numbers A003056 (orange)
- Jan Ritsema van Eck, Graph #2: 10000 terms (blue) and inverse triangular numbers A003056 (orange)
- N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 21.
- Index entries for sequences related to the inventory sequence
-
# See Links section. - Luc Rousseau, May 02 2021
-
function [val,arr]=invSeq(N) % val = Nth term, arr = whole array up to N
k=0;
arr=zeros(1,N); % pre-allocate array
for i=1:N
an=sum((k==arr(2:i)));
arr(i)=an;
if an == 0
k = 0;
else
k=k+1;
end
end
val=arr(end);
end % Ben Cha, Nov 11 2022
-
a:= proc(n) option remember; local t;
t:= `if`(a(n-1)=0, 0, b(n-1)+1);
b(n):=t; add(`if`(a(j)=t, 1, 0), j=1..n-1)
end: b(1), a(1):= 0$2:
seq(a(n), n=1..120); # Alois P. Heinz, Mar 16 2021
-
a[n_] := a[n] = Module[{t}, t = If[a[n-1] == 0, 0, b[n-1]+1];
b[n] = t; Sum[If[a[j] == t, 1, 0], {j, 1, n-1}]];
b[1] = 0; a[1] = 0;
Array[a, 120] (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)
-
A342585_vec(N,c=[],i)=vector(N,j, while(#c<=i||#c<=c[i+1], c=concat(c,0)); c[i+=1]+if(c[1+c[i]]++&&!c[i]||j==1,i=0)) \\ M. F. Hasler, Nov 13 2021
-
\\ See Links section.
-
def calc(required_value_number):
values_lst = []
current_count = 0
new_value = 0
for i in range(required_value_number):
new_value = values_lst.count(current_count)
values_lst.append(new_value)
if new_value == 0:
current_count = 0
else:
current_count += 1
return new_value # Written by Gilad Moyal
-
from collections import Counter
def aupton(terms):
num, alst, inventory = 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([c])
return alst
print(aupton(84)) # Michael S. Branicky, Jun 12 2021
-
# Prints the first 10,068 terms
library("dplyr")
options(max.print=11000)
inventory <- data.frame(1, 0)
colnames(inventory) <- c("n", "an")
value_to_count = 0
n = 1
for(x in 1:128) # Increase the 128 for more terms. The number of terms
# given is on the order of x^1.9 in the region around 128.
{
status <- TRUE
while(status)
{
count <- length(which(inventory$an == value_to_count))
n = n + 1
inventory <- rbind(inventory, c(n, count))
status <- isTRUE(count != 0)
value_to_count = value_to_count + 1
}
value_to_count = 0
}
inventory # Damon Lay, Nov 10 2023
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
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.
-
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 *)
A352799
Inventory sequence of binary weights.
Original entry on oeis.org
0, 1, 1, 0, 2, 3, 1, 0, 3, 4, 2, 0, 4, 7, 2, 1, 0, 5, 9, 4, 1, 0, 6, 11, 5, 2, 0, 7, 12, 7, 4, 0, 8, 14, 7, 6, 0, 9, 14, 9, 7, 0, 10, 14, 11, 10, 0, 11, 14, 12, 12, 0, 12, 14, 15, 13, 1, 0, 13, 15, 15, 15, 4, 0, 14, 16, 15, 16, 5, 0, 15, 18, 17, 16, 6, 0, 16
Offset: 0
a(0) = 0 because at the start there are no terms, therefore zero terms with binary weight zero.
a(1) = 1 because the first term (0) has binary weight zero and there is just one such term.
a(2) = 1 since a(1) = 1 has weight 1, and there is only one term with this weight.
a(3) = 0 since there are no terms with weight 2. Reset the count to zero weight and repeat.
a(4) = 2 because now there are 2 terms (a(0), a(3)) which have weight 0. And so on.
As an irregular triangle the sequence begins:
0;
1, 1, 0;
2, 3, 1, 0;
3, 4, 2, 0;
4, 7, 2, 1, 0;
5, 9, 4, 1, 0;
6, 11, 5, 2, 0;
-
Block[{a, c, j, k, m}, a[1] = c[] = 0; j = c[0] = 1; Do[k = 0; While[c[k] > 0, j++; Set[m, c[k]]; Set[a[j], m]; c[If[m < 1, 0, DigitCount[m, 2, 1] ] ]++; k++]; j++; Set[a[j], 0]; c[0]++, 25]; Array[a, j] ] (* _Michael De Vlieger, Jun 25 2025 *)
-
from collections import Counter
def w(n): return bin(n).count("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([w(c)])
return alst
print(aupton(76)) # Michael S. Branicky, Apr 03 2022
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
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.
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
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).
-
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
A383967
Inventory sequence recording number of terms with 1,2,3,... decimal digits. Count until occurrence of a term = 0, whereupon reset the count; continue.
Original entry on oeis.org
0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 1, 0, 13, 2, 0, 15, 3, 0, 17, 4, 0, 19, 5, 0, 21, 6, 0, 23, 7, 0, 25, 8, 0, 27, 9, 0, 29, 10, 0, 30, 12, 0, 31, 14, 0, 32, 16, 0, 33, 18, 0, 34, 20, 0, 35, 22, 0, 36, 24, 0, 37, 26, 0, 38, 28, 0, 39, 30, 0, 40, 32, 0, 41, 34
Offset: 1
a(1) = 0 because at first there are no terms with just one decimal digit. Following a zero term the count is reset and now since there is one term (a(1) = 0) with just one digit, a(2) = 1. Since there are no terms with two digits a(3) = 0. The count resets again and a(4) = 3 because there are now three terms (0,1,0) which have only one digit. Since there are no terms with two digits a(5) = 0.
The sequence continues 0,1,0,3,0,5,0,7,0,9,0 and at this point we have 11 terms with one digit then one term (11) with two digits, so the next two terms are 11,1 followed by 0 since there is not yet a term with three digits; and so on.
-
nn = 120; q[] := 0; f[x] := If[x == 0, 1, IntegerLength[x]]; j = 0; c = 1; q[1]++; {j}~Join~Reap[Do[If[j == 0, c = 1]; j = Sow[q[c]]; c++; q[f[j]]++, nn - 1] ][[-1, 1]] (* Michael De Vlieger, Jun 01 2025 *)
Showing 1-8 of 8 results.
Comments