OFFSET
1,2
COMMENTS
Also Heinz numbers of partitions whose reverse-alternating sum is >= 0. These are partitions whose conjugate parts are all even or whose length is odd.
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 alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
EXAMPLE
The sequence of terms together with their prime indices begins:
1: {} 20: {1,1,3} 45: {2,2,3}
2: {1} 23: {9} 47: {15}
3: {2} 25: {3,3} 48: {1,1,1,1,2}
4: {1,1} 27: {2,2,2} 49: {4,4}
5: {3} 28: {1,1,4} 50: {1,3,3}
7: {4} 29: {10} 52: {1,1,6}
8: {1,1,1} 30: {1,2,3} 53: {16}
9: {2,2} 31: {11} 59: {17}
11: {5} 32: {1,1,1,1,1} 61: {18}
12: {1,1,2} 36: {1,1,2,2} 63: {2,2,4}
13: {6} 37: {12} 64: {1,1,1,1,1,1}
16: {1,1,1,1} 41: {13} 66: {1,2,5}
17: {7} 42: {1,2,4} 67: {19}
18: {1,2,2} 43: {14} 68: {1,1,7}
19: {8} 44: {1,1,5} 70: {1,3,4}
For example, the prime indices of 70 are {1,3,4} with alternating sum 1 - 3 + 4 = 2, so 70 is in the sequence. On the other hand, the prime indices of 24 are {1,1,1,2} with alternating sum 1 - 1 + 1 - 2 = -1, so 24 is not in the sequence.
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
ats[y_]:=Sum[(-1)^(i-1)*y[[i]], {i, Length[y]}];
Select[Range[100], ats[primeMS[#]]>=0&]
CROSSREFS
Permutations of prime indices of these terms are counted by A116406.
Heinz numbers of the partitions counted by A344607.
A000070 counts partitions with alternating sum 1.
A000097 counts partitions with alternating sum 2.
A103919 counts partitions by sum and alternating sum.
A120452 counts partitions with reverse-alternating sum 2.
A344604 counts wiggly compositions with twins.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344612 counts partitions by sum and reverse-alternating sum.
A344618 gives reverse-alternating sums of standard compositions.
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 30 2021
STATUS
approved