A347299 Lengths of successive rows when the Inventory Sequence A342585 is written as a triangle.
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
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..16384 (first 10000 terms from Hugo Pfoertner)
- Index entries for sequences related to the inventory sequence
Programs
-
Mathematica
Prepend[Differences[#], First[#]] &@ 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 *) (* Faster code: *) Block[{c, m, k}, c[] = 0; Reap[Do[k = 0; While[c[k] > 0, Set[m, c[k]]; c[m]++; k++]; Set[m, c[k]]; Sow[k + 1]; c[m]++, {i, 53}]][[-1, -1]]] (* _Michael De Vlieger, Nov 13 2021 *)
-
Python
from collections import Counter def aupton(terms): num, A342585lst, inventory, alst, rowlen = 0, [0], Counter([0]), [1], 0 while len(alst) < terms: rowlen += 1 c = inventory[num] if c == 0: num = 0 alst.append(rowlen) rowlen = 0 else: num += 1 A342585lst.append(c) inventory.update([c]) return alst print(aupton(53)) # Michael S. Branicky, Aug 27 2021
Comments