OFFSET
0,2
COMMENTS
The partitions' representation (A228100) is a weakly decreasing list of parts.
The rows (read from left to right) are strongly decreasing. The T(n, 0) are the primorial numbers A002110(n). The right side of the triangle are the powers of 2,
The partition corresponding to a(n), n > 0, can be recovered as the exponents of the primes in the canonical prime factorization of a(n).
REFERENCES
D. E. Knuth: The Art of Computer Programming. Generating all combinations and partitions, vol. 4, fasc. 3, 7.2.1.4, exercise 10.
LINKS
Peter Luschny, Rows n = 0..25, flattened
T. I. Fenner, G. Loizou, A binary tree representation and related algorithms for generating integer partitions, The Computer J. 23(4), 332-337 (1980).
Peter Luschny, Integer Partition Trees
EXAMPLE
The six-th row is:
[1, 1, 1, 1, 1, 1] -> 30030
[2, 1, 1, 1, 1] -> 4620
[2, 2, 1, 1] -> 1260
[3, 1, 1, 1] -> 840
[2, 2, 2] -> 900
[3, 2, 1] -> 360
[4, 1, 1] -> 240
[3, 3] -> 216
[4, 2] -> 144
[5, 1] -> 96
[6] -> 64
MAPLE
b:= proc(n, i) b(n, i):= `if`(n=0 or i=1, [[1$n]], [b(n, i-1)[],
`if`(i>n, [], map(x-> [i, x[]], b(n-i, i)))[]])
end:
T:= n-> map(h-> mul(ithprime(j)^h[j], j=1..nops(h)), sort(b(n$2),
proc(x, y) local i; if nops(x)<>nops(y) then return
nops(x)>nops(y) else for i to nops(x) do if x[i]<>y[i]
then return x[i]<y[i] fi od fi end))[]:
seq(T(n), n=0..8); # Alois P. Heinz, Aug 13 2013
MATHEMATICA
b[n_, i_] := If[n == 0 || i == 1, {Array[1&, n]}, Join[b[n, i-1], If[i>n, {}, Map[Function[x, Prepend[x, i]], b[n-i, i]]]]]; T[n_] := Map[Function[h, Times @@ ((Prime /@ Range[Length[h]])^h)], Sort[b[n, n], Which[Length[#1] > Length[#2], True, Length[#1] < Length[#2], False, True, OrderedQ[#1, #2]]&]]; Table[T[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, Jan 27 2014, after Maple *)
PROG
(Sage)
from collections import deque
def Partitions_Fenner_Loizou(n):
p = ([], 0, n)
queue = deque()
queue.append(p)
yield p
while len(queue) > 0 :
(phead, pheadLen, pnum1s) = queue.popleft()
if pnum1s != 1 :
head = phead[:pheadLen] + [2]
q = (head, pheadLen + 1, pnum1s - 2)
if 1 <= q[2] : queue.append(q)
yield q
if pheadLen == 1 or (pheadLen > 1 and \
(phead[pheadLen - 1] != phead[pheadLen - 2])) :
head = phead[:pheadLen]
head[pheadLen - 1] += 1
q = (head, pheadLen, pnum1s - 1)
if 1 <= q[2] : queue.append(q)
yield q
def A228099_row(n):
if n == 0: return [1]
L = []
P = primes_first_n(n)
for p in Partitions_Fenner_Loizou(n):
e = p[0] + [1 for i in range(p[2])]
c = mul(P[i]^e[i] for i in range(len(e)))
L.append(c)
return L
for n in (0..7): A228099_row(n)
CROSSREFS
KEYWORD
AUTHOR
Peter Luschny, Aug 10 2013
STATUS
approved