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!)
A024937 a(n) = number of 2's in all partitions of n into distinct primes. 2

%I #16 Sep 07 2022 04:10:16

%S 0,0,1,0,0,1,0,1,0,1,1,0,1,1,1,1,1,1,2,1,2,2,2,2,2,3,3,2,3,3,3,4,3,5,

%T 4,4,5,5,6,6,5,7,7,7,8,8,9,8,9,11,11,10,12,12,13,14,14,16,15,16,17,19,

%U 20,20,20,22,24,23,26,27,27,28,30,33,34,34,36,37,40,41,43,46,46,47,50,55,56,56,58,63,64

%N a(n) = number of 2's in all partitions of n into distinct primes.

%H Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a024/A024937.java">Java program</a> (github)

%F G.f.: x^2*Product_{k>1} (1+x^prime(k)). - _Vladeta Jovovic_, Jul 20 2003

%p with(numtheory):

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

%p if n=0 then [1, 0]

%p elif i<1 then [0, 0]

%p else g:= `if`(ithprime(i)>n, [0$2], b(n-ithprime(i), i-1));

%p b(n, i-1) +g +[0, `if`(i=1,g[1],0)]

%p fi

%p end:

%p a:= n-> b(n, pi(n))[2]:

%p seq(a(n), n=0..80); # _Sean A. Irvine_, after _Alois P. Heinz_, Jul 29 2019

%t max = 100; (* number of terms *)

%t CoefficientList[x^2*Product[1+x^Prime[k], {k, 2, PrimePi[max]}]+O[x]^max, x] (* _Jean-François Alcover_, Sep 07 2022, after _Vladeta Jovovic_ *)

%Y Cf. A024939.

%K nonn

%O 0,19

%A _Clark Kimberling_

%E More terms from _Vladeta Jovovic_, Jul 20 2003

%E a(0)-a(6) prepended by _Sean A. Irvine_, Jul 29 2019

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)