A335452 Number of separations (Carlitz compositions or anti-runs) of the prime indices of n.
1, 1, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 0, 0, 2, 0, 1, 1, 6, 1, 0, 2, 2, 2, 2, 1, 2, 2, 0, 1, 6, 1, 1, 1, 2, 1, 0, 0, 1, 2, 1, 1, 0, 2, 0, 2, 2, 1, 6, 1, 2, 1, 0, 2, 6, 1, 1, 2, 6, 1, 1, 1, 2, 1, 1, 2, 6, 1, 0, 0, 2, 1, 6, 2, 2, 2
Offset: 1
Keywords
Examples
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)
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..4096
- Wikipedia, Permutation pattern
Crossrefs
Permutations of prime indices are counted by A008480.
Programs
-
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}]
-
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
Comments