OFFSET
1,6
COMMENTS
The first term that is not a factorial number is a(180) = 12.
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.
A separation (or Carlitz composition) of a multiset is a permutation with no adjacent equal parts.
a(n) depends only on the prime signature of n. - Andrew Howroyd, Feb 03 2021
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..4096
Wikipedia, Permutation pattern
EXAMPLE
The a(n) separations for n = 2, 6, 30, 180:
(1) (12) (123) (12123)
(21) (132) (12132)
(213) (12312)
(231) (12321)
(312) (13212)
(321) (21213)
(21231)
(21312)
(21321)
(23121)
(31212)
(32121)
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
Table[Length[Select[Permutations[primeMS[n]], !MatchQ[#, {___, x_, x_, ___}]&]], {n, 100}]
PROG
(PARI)
F(i, j, r, t) = {sum(k=max(0, i-j), min(min(i, t), (i-j+t)\2), binomial(i, k)*binomial(r-i+1, t+i-j-2*k)*binomial(t-1, k-i+j))}
count(sig)={my(s=vecsum(sig), r=0, v=[1]); for(p=1, #sig, my(t=sig[p]); v=vector(s-r-t+1, j, sum(i=1, #v, v[i]*F(i-1, j-1, r, t))); r += t); v[1]}
a(n)={count(factor(n)[, 2])} \\ Andrew Howroyd, Feb 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 21 2020
STATUS
approved