OFFSET
1,2
COMMENTS
Also Heinz numbers of integer partitions that are either a twin (x,x) or have a wiggly permutation.
(1) The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
(2) A sequence is wiggly if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no wiggly permutations, even though it has anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
EXAMPLE
The sequence of terms together with their prime indices begins:
1: {} 18: {1,2,2} 36: {1,1,2,2}
2: {1} 19: {8} 37: {12}
3: {2} 20: {1,1,3} 38: {1,8}
4: {1,1} 21: {2,4} 39: {2,6}
5: {3} 22: {1,5} 41: {13}
6: {1,2} 23: {9} 42: {1,2,4}
7: {4} 25: {3,3} 43: {14}
9: {2,2} 26: {1,6} 44: {1,1,5}
10: {1,3} 28: {1,1,4} 45: {2,2,3}
11: {5} 29: {10} 46: {1,9}
12: {1,1,2} 30: {1,2,3} 47: {15}
13: {6} 31: {11} 49: {4,4}
14: {1,4} 33: {2,5} 50: {1,3,3}
15: {2,3} 34: {1,7} 51: {2,7}
17: {7} 35: {3,4} 52: {1,1,6}
For example, the prime factors of 120 are (2,2,2,3,5), with the two wiggly permutations (2,3,2,5,2) and (2,5,2,3,2), so 120 is in the sequence.
MATHEMATICA
Select[Range[100], Select[Permutations[Flatten[ConstantArray@@@FactorInteger[#]]], !MatchQ[#, {___, x_, y_, z_, ___}/; x<=y<=z||x>=y>=z]&]!={}&]
CROSSREFS
Positions of nonzero terms in A344606.
These partitions are counted by A344740.
A001248 lists squares of primes.
A001250 counts wiggly permutations.
A003242 counts anti-run compositions.
A011782 counts compositions.
A344604 counts wiggly compositions with twins.
A345164 counts wiggly permutations of prime indices.
A345192 counts non-wiggly compositions.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 12 2021
STATUS
approved