1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 0, 1, 0, 0, 2, 2, 0, 1, 1, 1, 0, 0, 2, 2, 0, 0, 1, 2, 1, 0, 0, 2, 2, 0, 1, 0, 2, 2, 0, 0, 3, 2, 0, 0, 1, 2, 2, 0, 0, 2, 3, 1
Offset: 0
T(0,0) = 1: [], the empty partition.
T(2,1) = 1: [2].
T(5,1) = 1: [5], T(5,2) = 1: [2,3].
T(16,2) = 2: [5,11], [3,13].
Triangle T(n,k) begins:
1;
;
0, 1;
0, 1;
;
0, 1, 1;
;
0, 1, 1;
0, 0, 1;
0, 0, 1;
0, 0, 1, 1;
0, 1;
0, 0, 1, 1;
...
A219107
Number of compositions (ordered partitions) of n into distinct prime parts.
Original entry on oeis.org
1, 0, 1, 1, 0, 3, 0, 3, 2, 2, 8, 1, 8, 3, 8, 8, 10, 25, 16, 9, 16, 38, 16, 61, 18, 62, 46, 66, 160, 91, 138, 99, 70, 122, 306, 126, 314, 151, 362, 278, 588, 901, 602, 303, 654, 1142, 888, 1759, 892, 1226, 950, 2160, 1230, 3379, 1444, 2372, 2100, 4644, 7416
Offset: 0
a(5) = 3: [2,3], [3,2], [5].
a(7) = 3: [2,5], [5,2], [7].
a(8) = 2: [3,5], [5,3].
a(9) = 2: [2,7], [7,2].
a(10) = 8: [2,3,5], [2,5,3], [3,2,5], [3,5,2], [5,2,3], [5,3,2], [3,7], [7,3].
-
with(numtheory):
b:= proc(n, i) b(n, i):=
`if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1),
[0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i-1))[]], 0)))
end:
a:= proc(n) local l; l:= b(n, pi(n));
a(n):= add(l[i]*(i-1)!, i=1..nops(l))
end:
seq(a(n), n=0..70);
# second Maple program:
s:= proc(n) option remember; `if`(n<1, 0, ithprime(n)+s(n-1)) end:
b:= proc(n, i, t) option remember; `if`(s(i)`if`(p>n, 0, b(n-p, i-1, t+1)))(ithprime(i))+b(n, i-1, t)))
end:
a:= n-> b(n, numtheory[pi](n), 0):
seq(a(n), n=0..70); # Alois P. Heinz, Jan 30 2020
-
zip = With[{m=Max[Length[#1], Length[#2]]}, PadRight[#1, m]+PadRight[#2, m] ]&;
b[n_, i_] := b[n, i] = If[n==0, {1}, If[i<1, {}, b[n, i-1] ~zip~ Join[{0}, If[Prime[i] > n, {}, b[n - Prime[i], i-1]]], {0}]];
a[n_] := Module[{l}, l = b[n, PrimePi[n]]; Sum[l[[i]]*(i-1)!, {i, 1, Length[l]}]];
Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Mar 24 2017, adapted from Maple *)
A379315
Number of strict integer partitions of n with a unique 1 or prime part.
Original entry on oeis.org
0, 1, 1, 1, 0, 2, 1, 3, 1, 3, 2, 7, 3, 7, 4, 10, 7, 15, 7, 17, 13, 23, 16, 31, 20, 37, 31, 48, 38, 62, 48, 76, 68, 93, 80, 119, 105, 147, 137, 175, 166, 226, 208, 267, 263, 326, 322, 407, 391, 481, 492, 586, 591, 714, 714, 849, 884, 1020, 1050, 1232, 1263
Offset: 0
The a(10) = 2 through a(15) = 10 partitions:
(8,2) (11) (9,3) (13) (9,5) (8,7)
(9,1) (6,5) (10,2) (7,6) (12,2) (10,5)
(7,4) (6,4,2) (8,5) (8,4,2) (11,4)
(8,3) (10,3) (9,4,1) (12,3)
(9,2) (12,1) (14,1)
(10,1) (6,4,3) (6,5,4)
(6,4,1) (8,4,1) (8,4,3)
(8,6,1)
(9,4,2)
(10,4,1)
A376682 gives k-th differences of old primes.
-
Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&Count[#,_?(#==1||PrimeQ[#]&)]==1&]],{n,0,30}]
-
seq(n)={Vec(sum(k=1, n, if(isprime(k) || k==1, x^k)) * prod(k=4, n, 1 + if(!isprime(k), x^k), 1 + O(x^n)), -n-1)} \\ Andrew Howroyd, Dec 28 2024
A379301
Positive integers whose prime indices include a unique composite number.
Original entry on oeis.org
7, 13, 14, 19, 21, 23, 26, 28, 29, 35, 37, 38, 39, 42, 43, 46, 47, 52, 53, 56, 57, 58, 61, 63, 65, 69, 70, 71, 73, 74, 76, 77, 78, 79, 84, 86, 87, 89, 92, 94, 95, 97, 101, 103, 104, 105, 106, 107, 111, 112, 113, 114, 115, 116, 117, 119, 122, 126, 129, 130, 131
Offset: 1
The prime indices of 70 are {1,3,4}, so 70 is in the sequence.
The prime indices of 98 are {1,4,4}, so 98 is not in the sequence.
A066247 is the characteristic function for the composite numbers.
Other counts of prime indices:
-
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
Select[Range[100],Length[Select[prix[#],CompositeQ]]==1&]
Comments