login
A178683
Shortest partition of n with maximal product, sorted descending & considered as a base-5 number.
1
0, 1, 2, 3, 4, 17, 18, 23, 92, 93, 118, 467, 468, 593, 2342, 2343, 2968, 11717, 11718, 14843, 58592, 58593, 74218, 292967, 292968, 371093, 1464842, 1464843, 1855468, 7324217, 7324218, 9277343, 36621092, 36621093, 46386718, 183105467
OFFSET
0,3
LINKS
Roger Hui & Boyko Bantchev, J Wiki An Essay on Partitions
EXAMPLE
For n=10: the integer 10 has 42 partitions (e.g., 7+1+1+1, 6+4, 4+3+3, ...). The products of these partitions range from 1 (1*1*1*...) to 36.
There are only two partitions that have the maximal product of 36: (4,3,3) and (3,3,2,2). Of these, the former is shorter (3 elements vs 4). So 4,3,3 is the shortest maximal partition of 10.
This partition, sorted descending and considered as a number in base 5 (where each element of the partition is a digit), is (4*5^2) + (3*5^1) + (3*5^0) = 118. Hence a(10) = 118.
MAPLE
a:= proc(n) local m, q, r;
if n<5 then n
else q:= iquo(n, 3, 'r');
m:= 3*(5^q-1)/4;
if r=1 then m:= m +5^(q-1)
elif r=2 then m:= m *5+2
fi; m
fi
end:
seq(a(n), n=0..35); # Alois P. Heinz, Nov 26 2010
PROG
(J)
. aXXXX =: (5 #. ] {::~ [: (i. >./) */&>)@:part"0
. part =: 3 : 'final (, new)^:y <<i.1 0' NB. Here & below due to Hui
. final=: ; @: (<@-.&0"1&.>) @ > @ {:
. new =: (-i.)@# <@:(cat&.>) ]
. cat =: [ ; @:(, .&.>) -@(<.#) {. ]
CROSSREFS
Sequence in context: A300855 A353164 A333835 * A111191 A333825 A115891
KEYWORD
base,easy,nonn
AUTHOR
Dan Bron (dan(AT)bron.us), Jun 03 2010
STATUS
approved