OFFSET
1,6
COMMENTS
Differs from A335448 in having a(x^2) = 0 and a(270) = 0.
These are permutations of the prime factors of n, counting multiplicity, with no adjacent triples (..., x, y, z, ...) where x <= y <= z or x >= y >= z.
The version without twins (x,x) is A345164, which is identical to this sequence except when n is the square of a prime.
EXAMPLE
The permutations for n = 2, 6, 30, 180, 210, 300, 420, 720, 840:
2 23 253 23253 2537 25253 23275 2323252 232527
32 325 32325 2735 25352 25273 2325232 232725
352 32523 3275 32525 25372 2523232 252327
523 35232 3527 35252 27253 252723
52323 3725 52325 27352 272325
5273 52523 32527 272523
5372 32725 325272
5723 35272 327252
7253 37252 523272
7352 52327 527232
52723 723252
57232 725232
72325
72523
For example, there are no alternating permutations of the prime factors of 270 because the only anti-runs are {3,2,3,5,3} and {3,5,3,2,3}, neither of which is alternating, so a(270) = 0.
MATHEMATICA
Table[Length[Select[Permutations[Flatten[ConstantArray@@@FactorInteger[n]]], !MatchQ[#, {___, x_, y_, z_, ___}/; x<=y<=z||x>=y>=z]&]], {n, 100}]
CROSSREFS
The version for permutations is A001250.
The extension to anti-run permutations is A335452.
The version for compositions is A344604.
The version for patterns is A344605.
Not including twins (x,x) gives A345164.
A316523 is a signed sum of prime multiplicities.
A344740 counts partitions with an alternating permutation or twin (x,x).
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 28 2021
STATUS
approved