login
A391981
Irregular triangle read by rows where row n lists the trimmed zero-based partial alternating sums of the prime indices of n.
27
1, 2, 1, 0, 3, 1, 1, 4, 1, 0, 1, 2, 0, 1, 2, 5, 1, 0, 2, 6, 1, 3, 2, 1, 1, 0, 1, 0, 7, 1, 1, 1, 8, 1, 0, 3, 2, 2, 1, 4, 9, 1, 0, 1, 1, 3, 0, 1, 5, 2, 0, 2, 1, 0, 4, 10, 1, 1, 2, 11, 1, 0, 1, 0, 1, 2, 3, 1, 6, 3, 1, 1, 0, 2, 0, 12, 1, 7, 2, 4, 1, 0, 1, 2, 13
OFFSET
2,2
COMMENTS
Row 1 is empty, so offset is 2.
All terms are nonnegative.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The k-based partial alternating sums of a finite sequence q are given by pas(q,k)_j = (-1)^j * k + Sum_{i=1..j} (-1)^(i+j) * q_i. This is a signed version of the partial sums transformation, inverse to the "first sums" transformation.
For example, the partial alternating sums of q = (a,b,c,d,e) are:
pas(q,k)_0 = k
pas(q,k)_1 = -k + a
pas(q,k)_2 = k - a + b
pas(q,k)_3 = -k + a - b + c
pas(q,k)_4 = k - a + b - c + d
pas(q,k)_5 = -k + a - b + c - d + e
These are trimmed by removing the zeroth line (which is always k).
EXAMPLE
The prime indices of 12 are (1,1,2), and pas((1,1,2),0) = (0,1,0,2), so row 12 is (1,0,2).
Triangle begins:
1:
2: 1
3: 2
4: 1 0
5: 3
6: 1 1
7: 4
8: 1 0 1
9: 2 0
10: 1 2
11: 5
12: 1 0 2
13: 6
14: 1 3
15: 2 1
16: 1 0 1 0
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
pas[y_, k_]:=Table[(-1)^j*k+Sum[(-1)^(i-j)*y[[i]], {i, j}], {j, 0, Length[y]}];
Table[Rest[pas[prix[n], 0]], {n, 20}]
CROSSREFS
Row lengths are A001222.
The first term in each row is A055396, reverse A061395.
Rows with no zeros appear to be A283050, complement A247180.
Last term in each row is A344616, reverse A316524.
Row sums are A346699.
The version for reversed prime indices is A391982, row sums A346697.
For standard compositions we have A391983, row sums A392369, even A392370.
For reversed standard compositions we have A391984, row sums A209281, even A346633.
A056239 adds up prime indices, row sums of A112798.
A103919 counts partitions by sum and alternating sum (reverse A344612).
A344606 counts alternating permutations of prime indices.
A344610 counts partitions by sum and positive reverse-alternating sum.
A390307 lists first sums of prime indices, see A390362, A390448, A390449.
A390676 ranks compositions that are first sums, union of A390568.
A390989 counts partitions by sum of first sums, ranks A390990.
Sequence in context: A391984 A029312 A287352 * A243715 A333661 A143256
KEYWORD
nonn,tabf
AUTHOR
Gus Wiseman, Dec 26 2025
STATUS
approved