OFFSET
1,4
COMMENTS
For a partition p = (p(1),p(2),...,p(k)) of n, where p(1) >= p(2) >= ... >= p(k), define r(p) by subtracting 1 from p(1) and adding 1 to p(k) and then arranging the result in nonincreasing order. Iterating r eventually results in repetition; the function f(p) is the number of iterations of r up to but not including the first repeat. For example, starting with (5,3,2,2,1,1,1,1), the r-iterates are (4,3,2,2,2,1,1,1), (3,3,2,2,2,2,1,1), (3,2,2,2,2,2,2,1), (2,2,2,2,2,2,2,2), (3,2,2,2,2,2,2,1), so that f(5,3,2,2,1,1,1,1) = 3.
LINKS
John Tyler Rascoe, Rows n = 1..60, flattened
EXAMPLE
First 18 rows:
1
1 1
2 1
2 3
4 3
3 6 2
6 6 3
5 9 5 3
7 9 9 4 1
7 13 12 6 4
10 12 15 12 5 2
7 16 19 16 12 5 2
12 16 24 22 18 6 3
11 20 28 29 24 14 6 3
12 19 31 34 36 24 13 4 3
12 23 36 42 50 30 25 8 4 1
16 23 42 54 59 45 34 15 5 4
13 28 47 57 74 61 52 28 16 5 4
Row 6 represents 3 partitions p that are self-repeating (i.e., k = 0), 6 such that f(p) = 1, and 2 such that f(p) = 2. Specifically,
f(p) = 0 for these partitions: [6], [2,2,1,1], [2,1,1,1].
f(p) = 1 for these: [4,2], [3,3], [3,2,1], [3,1,1,1], [2,2,2], [1,1,1,1,1,1].
f(p) = 2 for these: [5,1], [4,1,1].
MATHEMATICA
r[list_] := If[Length[list] == 1, list, Reverse[Sort[# +
Join[{-1}, ConstantArray[0, Length[#] - 2], {1}]] &[Reverse[Sort[list]]]]];
f[list_] := NestWhileList[r, Reverse[Sort[list]], Unequal, All];
t = Table[BinCounts[#, {0, Max[#] + 1, 1}] &[Map[-1 + Length[Union[#]] &[f[#]] &, IntegerPartitions[n]]], {n, 1, 20}]
Map[Length, t]; t1 = Take[t, 18]; TableForm[t1]
Flatten[t1]
(* Peter J. C. Moses, Oct 10 2023 *)
PROG
(Python)
from sympy .utilities.iterables import ordered_partitions
from collections import Counter
def A366525_rowlist(row_n):
A = []
for i in range(1, row_n+1):
A.append([]); p, C = list(ordered_partitions(i)), Counter()
for j in range(0, len(p)):
x, a1, a, b = 0, [], list(p[j]), list(p[j])
while i:
b[-1] -= 1; b[0] += 1
if b[-1] == 0: b.pop(-1)
b = sorted(b); x += 1
if a == b or a1 == b:
C.update({x}); break
else:
a1 = a.copy(); a = b.copy()
for z in range(1, len(C)+1): A[i-1].append(C[z])
return(A) # John Tyler Rascoe, Nov 09 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Oct 12 2023
STATUS
approved