A362372 Inventory of powers. Initialize the sequence with '1'. Then record the number of powers of 1 thus far, then do the same for powers of 2 (2, 4, 8, ...), powers of 3, etc. When the count is zero, do not record a zero; rather start the inventory again with the powers of 1.
1, 1, 2, 1, 3, 1, 1, 5, 1, 1, 7, 1, 1, 9, 1, 2, 10, 2, 2, 10, 4, 2, 1, 1, 12, 6, 2, 1, 1, 1, 1, 16, 8, 2, 2, 1, 1, 1, 1, 1, 2, 21, 12, 2, 2, 1, 1, 1, 1, 1, 2, 26, 15, 2, 2, 1, 1, 1, 1, 1, 2, 31, 18, 2, 2, 1, 1, 1, 1, 1, 2, 36, 21, 2, 2, 1, 2, 1, 1, 1
Offset: 0
Examples
As an irregular triangle, the table begins: 1; 1; 2, 1; 3, 1, 1; 5, 1, 1; 7, 1, 1; 9, 1, 2; 10, 2, 2; 10, 4, 2, 1, 1; 12, 6, 2, 1, 1, 1, 1; 16, 8, 2, 2, 1, 1, 1, 1, 1, 2; ... Initialize the sequence with '1'. Powers of 1 are counted in the first column, powers of 2 in the second, powers of 3 in the third, etc.
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..10000 (first 4330 terms from Damon Lay)
Programs
-
Python
from collections import Counter from sympy import divisors, perfect_power def powers_in(n): t = perfect_power(n) # False for n == 1 return [n] if not t else [t[0]**d for d in divisors(t[1])] def aupton(nn): num, alst, inventory = 1, [1], Counter([1]) while len(alst) <= nn: c = inventory[num] if c == 0: num = 1 else: num += 1; alst.append(c); inventory.update(powers_in(c)) return alst print(aupton(100)) # Michael S. Branicky, May 05 2023
Comments