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!)
A237125 Number of partitions of n such that no part is a prime divisor of n. 3

%I #25 Nov 11 2015 12:14:56

%S 1,1,1,2,3,6,4,14,11,19,16,55,20,100,50,72,96,296,79,489,167,328,349,

%T 1254,271,1331,816,1435,980,4564,506,6841,2745,4027,3840,6816,2366,

%U 21636,7845,12027,6583,44582,4293,63260,18700,20259,29920,124753,15842,120351

%N Number of partitions of n such that no part is a prime divisor of n.

%C If n is prime, a(n) = A000041(n) - 1.

%H Alois P. Heinz, <a href="/A237125/b237125.txt">Table of n, a(n) for n = 0..1000</a>

%e With n = 6, the prime divisors of 6 are 2 and 3, and the partitions of 6 that do not contain either 2 or 3 are: [6], [5,1], [4,1,1] and [1,1,1,1,1,1], so a(6) = 4.

%p with(numtheory): with(combinat):

%p a:= proc(n) local b, s; s:= factorset(n);

%p b:= proc(n, i) option remember;

%p `if`(n=0, 1, `if`(i<1, 0, b(n, i-1)+

%p `if`(i>n or i in s, 0, b(n-i, i))))

%p end;

%p `if`(isprime(n), numbpart(n)-1, b(n$2))

%p end:

%p seq(a(n), n=0..50); # _Alois P. Heinz_, Feb 04 2014

%t a[1]=1; a[n_] := If[PrimeQ[n], PartitionsP[n] - 1, Block[{p = First /@ FactorInteger@n}, Length@ Select[ IntegerPartitions[n], Intersection[#, p] == {} &]]]; Array[a, 50] (* _Giovanni Resta_, Feb 04 2014 *)

%t a[0] = a[1] = 1; a[n_] := Module[{b, s}, s = FactorInteger[n][[All,1]]; b[m_, i_] := b[m, i] = If[m == 0, 1, If[i<1, 0, b[m, i-1]+ If[i>m || MemberQ[s, i], 0, b[m-i, i]]]]; If[PrimeQ[n], PartitionsP[n]-1, b[n, n] ]]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Nov 11 2015, after _Alois P. Heinz_ *)

%Y Cf. A236937, A236938.

%K nonn,look

%O 0,4

%A _J. Stauduhar_, Feb 03 2014

%E a(8)-a(49) from _Giovanni Resta_, Feb 04 2014

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 July 22 19:00 EDT 2024. Contains 374540 sequences. (Running on oeis4.)