cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A336632 Number of prime parts, counted without multiplicity, in all compositions of n.

This page as a plain text file.
%I A336632 #12 May 30 2022 08:14:58
%S A336632 0,0,1,3,6,15,33,74,160,344,731,1544,3237,6753,14022,29009,59819,
%T A336632 123010,252341,516560,1055476,2153115,4385889,8922556,18131000,
%U A336632 36805009,74643126,151255021,306267833,619719217,1253191291,2532750315,5116124712,10329574480
%N A336632 Number of prime parts, counted without multiplicity, in all compositions of n.
%H A336632 Alois P. Heinz, <a href="/A336632/b336632.txt">Table of n, a(n) for n = 0..1000</a>
%e A336632 a(4) = 0 + 1 + 1 + 1 + 1 + 1 + 1 + 0 = 6: 1111, 11(2), 1(2)1, (2)11, (2)2, 1(3), (3)1, 4.
%p A336632 b:= proc(n, i, p) option remember; `if`(n=0, [p!, 0],
%p A336632       `if`(i<1, 0, add((h-> [0, `if`(j>0 and isprime(i),
%p A336632        h[1], 0)]+h)(b(n-i*j, i-1, p+j)/j!), j=0..n/i)))
%p A336632     end:
%p A336632 a:= n-> b(n$2, 0)[2]:
%p A336632 seq(a(n), n=0..38);
%t A336632 b[n_, i_, p_] := b[n, i, p] = If[n == 0, {p!, 0},
%t A336632      If[i < 1, 0, Sum[Function[h, {0, If[j > 0 && PrimeQ[i],
%t A336632      h[[1]], 0]} + h][b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]];
%t A336632 a[n_] := b[n, n, 0][[2]];
%t A336632 Table[a[n], {n, 0, 38}] (* _Jean-François Alcover_, May 30 2022, after _Alois P. Heinz_ *)
%Y A336632 Cf. A000040, A102291, A336579.
%K A336632 nonn
%O A336632 0,4
%A A336632 _Alois P. Heinz_, Jul 28 2020