login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338630 Least number of odd primes that add up to n, or 0 if no such representation is possible. 0
0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
LINKS
Eric Weisstein's World of Mathematics, Prime Partition
EXAMPLE
a(9) = 3 because 9 = 3 + 3 + 3 is a partition of 9 into 3 odd prime parts and there is no such partition with fewer terms.
MATHEMATICA
Block[{f, a}, f[m_] := Block[{s = {Prime@ PrimePi@ m}}, KeySort@ Merge[#, Identity] &@ Reap[Do[If[# <= m, Sow[# -> s]; AppendTo[s, Last@ s], If[Last@ s == 3, s = DeleteCases[s, 3]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]]] &@ Total[s], {i, Infinity}]][[-1, -1]] ]; a = f[105]; Array[If[KeyExistsQ[a, #], Min@ Map[Length, Lookup[a, #]], 0] &, Max@ Keys@ a]] (* Michael De Vlieger, Nov 04 2020 *)
CROSSREFS
Sequence in context: A329744 A277889 A018194 * A286281 A229830 A105203
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Nov 04 2020
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 02:25 EDT 2024. Contains 371782 sequences. (Running on oeis4.)