A218007 Number of partitions of n into at most three primes (including 1).
1, 2, 3, 3, 4, 4, 5, 4, 5, 4, 5, 4, 6, 5, 7, 5, 7, 5, 8, 6, 9, 6, 9, 7, 10, 7, 10, 5, 10, 6, 12, 7, 13, 7, 12, 8, 14, 7, 14, 6, 15, 8, 17, 9, 17, 8, 18, 10, 19, 10, 19, 7, 20, 9, 21, 9, 20, 7, 21, 11, 25, 11, 24, 9, 26, 11, 27, 9, 24, 8, 28, 12, 30, 13, 29
Offset: 1
Keywords
Examples
a(21)=9 as 21 = 1+1+19 = 2+19 = 1+3+17 = 2+2+17 = 1+7+13 = 3+5+13 = 3+7+11 = 5+5+11 = 7+7+7
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
primeQ[p0_] := If[p0==1, True, PrimeQ[p0]]; SetAttributes[primeQ, Listable]; goldbachcount[p1_] := (parts=IntegerPartitions[p1, 3]; count=0; n=1; While[n<=Length[parts], If[Intersection[Flatten[primeQ[parts[[n]]]]][[1]] == True, count++]; n++]; count); Table[goldbachcount[i], {i, 1, 100}] Table[Length[Select[#/.(1->2)&/@IntegerPartitions[n,3],AllTrue[#,PrimeQ]&]],{n,80}] (* Harvey P. Dale, Jan 11 2023 *)
Comments