A224344
Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.
Original entry on oeis.org
1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
Offset: 0
A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 3;
2, 5, 1;
3, 8, 5;
5, 13, 13, 1;
7, 23, 27, 7;
11, 39, 52, 25, 1;
17, 65, 99, 66, 9;
27, 106, 186, 151, 41, 1;
40, 177, 340, 323, 133, 11;
...
-
T:= proc(n) option remember; local j; if n=0 then 1
else []; for j to n do zip((x, y)->x+y, %,
[`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
end:
seq(T(n), n=0..16);
-
zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] = Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
A309561
Total sum of prime parts in all compositions of n.
Original entry on oeis.org
0, 0, 2, 7, 16, 44, 102, 244, 554, 1247, 2772, 6111, 13334, 28916, 62302, 133557, 285020, 605869, 1283362, 2710008, 5706546, 11986171, 25118500, 52529339, 109643310, 228455907, 475250388, 987177924, 2047710144, 4242128909, 8777675002, 18142184432, 37458037658
Offset: 0
a(4) = 16: 1111, (2)11, 1(2)1, 11(2), (2)(2), (3)1, 1(3), 4.
-
a:= proc(n) option remember; add(a(n-j) +j*
`if`(isprime(j), ceil(2^(n-j-1)), 0), j=1..n)
end:
seq(a(n), n=0..33);
-
a[n_] := a[n] = Sum[a[n-j]+j*If[PrimeQ[j], Ceiling[2^(n-j-1)], 0], {j, 1, n}];
a /@ Range[0, 33] (* Jean-François Alcover, Jan 03 2021, after Alois P. Heinz *)
A336632
Number of prime parts, counted without multiplicity, in all compositions of n.
Original entry on oeis.org
0, 0, 1, 3, 6, 15, 33, 74, 160, 344, 731, 1544, 3237, 6753, 14022, 29009, 59819, 123010, 252341, 516560, 1055476, 2153115, 4385889, 8922556, 18131000, 36805009, 74643126, 151255021, 306267833, 619719217, 1253191291, 2532750315, 5116124712, 10329574480
Offset: 0
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.
-
b:= proc(n, i, p) option remember; `if`(n=0, [p!, 0],
`if`(i<1, 0, add((h-> [0, `if`(j>0 and isprime(i),
h[1], 0)]+h)(b(n-i*j, i-1, p+j)/j!), j=0..n/i)))
end:
a:= n-> b(n$2, 0)[2]:
seq(a(n), n=0..38);
-
b[n_, i_, p_] := b[n, i, p] = If[n == 0, {p!, 0},
If[i < 1, 0, Sum[Function[h, {0, If[j > 0 && PrimeQ[i],
h[[1]], 0]} + h][b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]];
a[n_] := b[n, n, 0][[2]];
Table[a[n], {n, 0, 38}] (* Jean-François Alcover, May 30 2022, after Alois P. Heinz *)
A284942
Expansion of Sum_{k>=1} mu(k)^2*x^k*(1 - x)^2/(1 - 2*x)^2, where mu() is the Moebius function (A008683).
Original entry on oeis.org
1, 3, 8, 19, 46, 107, 244, 547, 1213, 2665, 5807, 12567, 27042, 57899, 123428, 262115, 554750, 1170538, 2463154, 5170462, 10829234, 22635087, 47223412, 98353299, 204519549, 424665001, 880581806, 1823667221, 3772341661, 7794697759, 16089424392, 33178906531, 68357928558
Offset: 1
a(4) = 19 because we have [4], [3, 1], [2, 2], [2, 1, 1], [1, 3], [1, 2, 1], [1, 1, 2], [1, 1, 1, 1] and 0 + 2 + 2 + 3 + 2 + 3 + 3 + 4 = 19.
-
a:= proc(n) option remember; add(`if`(numtheory[
issqrfree](j), ceil(2^(n-j-1)), 0)+a(n-j), j=1..n)
end:
seq(a(n), n=1..33); # Alois P. Heinz, Aug 07 2019
-
nmax = 33; Rest[CoefficientList[Series[Sum[MoebiusMu[k]^2 x^k (1 - x)^2/(1 - 2 x)^2, {k, 1, nmax}], {x, 0, nmax}], x]]
-
x='x+O('x^34); Vec(sum(k=1, 34, moebius(k) ^2*x^k*(1 - x)^2/(1 - 2*x)^2)) \\ Indranil Ghosh, Apr 06 2017
A284943
Expansion of Sum_{p prime, k>=1} x^(p^k)*(1 - x)^2/(1 - 2*x)^2.
Original entry on oeis.org
0, 1, 3, 8, 20, 47, 110, 251, 564, 1251, 2750, 5994, 12978, 27934, 59825, 127565, 270959, 573575, 1210466, 2547562, 5348385, 11203292, 23419629, 48865346, 101782870, 211670094, 439548898, 911515214, 1887865266, 3905400206, 8070139762, 16658958223, 34355273843
Offset: 1
a(5) = 20 because we have [5], [4, 1], [3, 2], [3, 1, 1], [2, 3], [2, 2, 1], [2, 1, 2], [2, 1, 1, 1], [1, 4], [1, 3, 1], [1, 2, 2], [1, 2, 1, 1], [1, 1, 3], [1, 1, 2, 1], [1, 1, 1, 2], [1, 1, 1, 1, 1] and 1 + 1 + 2 + 1 + 2 + 2 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 1 + 1 + 0 = 20.
-
b:= proc(n) option remember; nops(ifactors(n)[2])=1 end:
a:= proc(n) option remember; `if`(n=0, 0, add(a(n-j)+
`if`(b(j), ceil(2^(n-j-1)), 0), j=1..n))
end:
seq(a(n), n=1..33); # Alois P. Heinz, Aug 07 2019
-
nmax = 33; Rest[CoefficientList[Series[Sum[Floor[1/PrimeNu[k]] x^k (1 - x)^2/(1 - 2 x)^2, {k, 2, nmax}], {x, 0, nmax}], x]]
-
x='x+O('x^34); concat([0], Vec(sum(k=2, 34, (1\omega(k))*x^k*(1 - x)^2/(1 - 2*x)^2))) \\ Indranil Ghosh, Apr 06 2017
A309535
Total number of square parts in all compositions of n.
Original entry on oeis.org
0, 1, 2, 5, 13, 30, 69, 156, 348, 769, 1682, 3653, 7884, 16924, 36160, 76944, 163137, 344770, 726533, 1527052, 3202076, 6700096, 13992080, 29167936, 60703424, 126141953, 261754114, 542448645, 1122778124, 2321317916, 4794159168, 9891365008, 20388823360
Offset: 0
a(4) = 13: (1)(1)(1)(1), (1)(1)2, (1)2(1), 2(1)(1), 22, (1)3, 3(1), (4).
-
a:= proc(n) option remember; add(a(n-j)+
`if`(issqr(j), ceil(2^(n-j-1)), 0), j=1..n)
end:
seq(a(n), n=0..33);
-
CoefficientList[Series[(EllipticTheta[3, 0, x]-1)*(1-x)^2/(2*(1-2*x)^2), {x, 0, 30}], x] (* Vaclav Kotesovec, Aug 18 2019 *)
Table[Sum[If[k == n, 1, (2^(n - k - 2)*(3 + n - k))] * If[IntegerQ[Sqrt[k]], 1, 0], {k, 1, n}], {n, 0, 30}] (* Vaclav Kotesovec, Aug 18 2019 *)
A309536
Total number of triangular numbers in all compositions of n.
Original entry on oeis.org
0, 1, 2, 6, 14, 33, 77, 174, 389, 860, 1885, 4098, 8853, 19020, 40668, 86593, 183698, 388421, 818892, 1721884, 3611968, 7560337, 15793474, 32932549, 68556300, 142495004, 295754816, 613039248, 1269137729, 2624393922, 5421024773, 11186523404, 23061994524
Offset: 0
a(4) = 14: (1)(1)(1)(1), 2(1)(1), (1)2(1), (1)(1)2, 22, (3)(1), (1)(3), 4.
-
a:= proc(n) option remember; add(a(n-j)+
`if`(issqr(8*j+1), ceil(2^(n-j-1)), 0), j=1..n)
end:
seq(a(n), n=0..33);
-
CoefficientList[Series[(EllipticTheta[2, 0, Sqrt[x]]/(2*x^(1/8)) - 1)*((1 - x)^2/(1 - 2*x)^2), {x, 0, 30}], x] (* Vaclav Kotesovec, Aug 18 2019 *)
A309537
Total number of Fibonacci parts in all compositions of n.
Original entry on oeis.org
0, 1, 3, 8, 19, 46, 106, 241, 541, 1198, 2629, 5724, 12380, 26625, 56978, 121413, 257740, 545308, 1150272, 2419856, 5078336, 10633921, 22222338, 46353669, 96525324, 200686620, 416645184, 863834256, 1788756288, 3699688128, 7643727360, 15776156928, 32529718272
Offset: 0
-
a:= proc(n) option remember; add(a(n-j)+`if`((t->issqr(t+4)
or issqr(t-4))(5*j^2), ceil(2^(n-j-1)), 0), j=1..n)
end:
seq(a(n), n=0..33);
-
a[n_] := a[n] = Sum[a[n - j] + With[{t = 5 j^2}, If[IntegerQ@Sqrt[t + 4] || IntegerQ@Sqrt[t - 4], Ceiling[2^(n - j - 1)], 0]], {j, 1, n}];
a /@ Range[0, 33] (* Jean-François Alcover, Dec 29 2020, after Alois P. Heinz *)
A309538
Total number of factorial parts in all compositions of n.
Original entry on oeis.org
0, 1, 3, 7, 17, 40, 93, 210, 469, 1036, 2268, 4928, 10640, 22848, 48832, 103936, 220416, 465920, 982016, 2064384, 4329472, 9060352, 18923520, 39452672, 82116609, 170655746, 354156549, 734003212, 1519386652, 3141533760, 6488588432, 13388218688, 27598521024
Offset: 0
-
g:= proc(n) local i; 1; for i from 2 do
if n=% then 1; break elif n<% then 0; break fi;
%*i od; g(n):=%
end:
a:= proc(n) option remember; add(a(n-j)+
`if`(g(j)=1, ceil(2^(n-j-1)), 0), j=1..n)
end:
seq(a(n), n=0..33);
-
g[n_] := g[n] = Module[{i, p = 1}, For[i = 2, True, i++, If[n == p, p = 1; Break[], If[nJean-François Alcover, Jan 10 2023, after Alois P. Heinz *)
Showing 1-9 of 9 results.
Comments