login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Table of n, a(n) for n=1..110.

Eric Weisstein's World of Mathematics, Prime Partition

Index entries for sequences related to Goldbach conjecture

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

Cf. A051034, A065091.

Sequence in context: A329744 A277889 A018194 * A286281 A229830 A105203

Adjacent sequences:  A338627 A338628 A338629 * A338631 A338632 A338633

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 09:57 EDT 2021. Contains 343666 sequences. (Running on oeis4.)