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!)
A132381 Number of partitions of n with exactly one prime number. 2
0, 1, 2, 3, 4, 7, 9, 12, 15, 22, 28, 38, 46, 62, 77, 98, 117, 152, 183, 230, 275, 344, 408, 504, 592, 726, 856, 1038, 1212, 1469, 1712, 2048, 2380, 2839, 3288, 3901, 4500, 5313, 6127, 7193, 8254, 9671, 11081, 12909, 14764, 17153, 19566, 22658, 25786, 29762 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..5000

EXAMPLE

a(10) = #{8+2, 7+1+1+1, 6+3+1, 6+2+2, 6+2+1+1, 5+5, 5+4+1, 5+1+1+1+1+1, 4+4+2, 4+3+3, 4+3+1+1+1, 4+2+2+2, 4+2+2+1+1, 4+2+1+1+1+1, 3+3+3+1, 3+3+1+1+1+1, 3+1+1+1+1+1+1+1, 2+2+2+2+2, 2+2+2+2+1+1, 2+2+2+1+1+1+1, 2+2+1+1+1+1+1+1, 2+1+1+1+1+1+1+1+1} = 22.

MAPLE

b:= proc(n, i) option remember; local j; if n=0 then [1, 0] elif i<1

      then [0$2] else b(n, i-1); for j to n/i do zip((x, y)->x+y, %,

      [`if`(isprime(i), 0, NULL), b(n-i*j, i-1)[]], 0) od; %[1..2] fi

    end:

a:= n-> b(n$2)[2]:

seq(a(n), n=1..60);  # Alois P. Heinz, May 29 2013

MATHEMATICA

zip = With[{m = Max[Length[#1], Length[#2]]}, PadRight[#1, m] + PadRight[#2, m]]&; b[n_, i_] := b[n, i] = Module[{j, pc}, Which[n == 0, {1, 0}, i<1, {0, 0}, True, pc = b[n, i-1]; For[j = 1, j <= n/i, j++, pc = zip[pc, Join[{If[PrimeQ[i], 0, Nothing]}, b[n-i*j, i-1]]] ]; pc[[1 ;; 2]] ]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 60}] (* Jean-Fran├žois Alcover, Feb 12 2017, after Alois P. Heinz *)

CROSSREFS

Cf. A002095.

Column k=1 of A274517.

Sequence in context: A084913 A270839 A117450 * A073152 A325092 A247186

Adjacent sequences:  A132378 A132379 A132380 * A132382 A132383 A132384

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller, Nov 10 2007

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 October 20 03:04 EDT 2021. Contains 348099 sequences. (Running on oeis4.)