login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..1000

E. W. Dijkstra, EWD Archive To hell with "meaningful identifiers" - EWD1044

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 programming language, see http://www.jsoftware.com)

. 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: A004833 A283515 A229546 * A111191 A115891 A037394

Adjacent sequences:  A178680 A178681 A178682 * A178684 A178685 A178686

KEYWORD

base,easy,nonn

AUTHOR

Dan Bron (dan(AT)bron.us), Jun 03 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 25 01:30 EDT 2017. Contains 284036 sequences.