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!)
A339433 Number of compositions (ordered partitions) of n into an odd number of distinct primes. 2

%I #11 Feb 26 2022 04:56:38

%S 0,0,1,1,0,1,0,1,0,0,6,1,6,1,6,6,6,1,12,7,12,12,12,13,12,12,18,18,132,

%T 19,132,25,18,24,252,30,258,31,264,156,486,37,498,157,504,276,738,175,

%U 738,288,750,528,984,307,1218,666,1110,780,6378,679,6618,799,1716,1272

%N Number of compositions (ordered partitions) of n into an odd number of distinct primes.

%H Alois P. Heinz, <a href="/A339433/b339433.txt">Table of n, a(n) for n = 0..5000</a>

%H <a href="/index/Com#comp">Index entries for sequences related to compositions</a>

%e a(10) = 6 because we have [5, 3, 2], [5, 2, 3], [3, 5, 2], [3, 2, 5], [2, 5, 3] and [2, 3, 5].

%p b:= proc(n, i, p) option remember; `if`(n=0, irem(p, 2)*p!, (s->

%p `if`(s>n, 0, b(n, i+1, p)+b(n-s, i+1, p+1)))(ithprime(i)))

%p end:

%p a:= n-> b(n, 1, 0):

%p seq(a(n), n=0..70); # _Alois P. Heinz_, Dec 04 2020

%t b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[p, 2]*p!, Function[s, If[s > n, 0, b[n, i + 1, p] + b[n - s, i + 1, p + 1]]][Prime[i]]];

%t a[n_] := b[n, 1, 0];

%t Table[a[n], {n, 0, 70}] (* _Jean-François Alcover_, Feb 26 2022, after _Alois P. Heinz_ *)

%Y Cf. A000040, A184172, A219107, A332304, A339383, A339409, A339432.

%K nonn

%O 0,11

%A _Ilya Gutkovskiy_, Dec 04 2020

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 June 28 03:42 EDT 2024. Contains 373761 sequences. (Running on oeis4.)