A355533 Irregular triangle read by rows where row n lists the differences between adjacent prime indices of n; if n is prime(k), then row n is just (k).
1, 2, 0, 3, 1, 4, 0, 0, 0, 2, 5, 0, 1, 6, 3, 1, 0, 0, 0, 7, 1, 0, 8, 0, 2, 2, 4, 9, 0, 0, 1, 0, 5, 0, 0, 0, 3, 10, 1, 1, 11, 0, 0, 0, 0, 3, 6, 1, 0, 1, 0, 12, 7, 4, 0, 0, 2, 13, 1, 2, 14, 0, 4, 0, 1, 8, 15, 0, 0, 0, 1, 0, 2, 0
Offset: 2
Examples
Triangle begins (showing n, prime indices, differences*): 2: (1) 1 3: (2) 2 4: (1,1) 0 5: (3) 3 6: (1,2) 1 7: (4) 4 8: (1,1,1) 0 0 9: (2,2) 0 10: (1,3) 2 11: (5) 5 12: (1,1,2) 0 1 13: (6) 6 14: (1,4) 3 15: (2,3) 1 16: (1,1,1,1) 0 0 0 For example, the prime indices of 24 are (1,1,1,2), with differences (0,0,1).
Links
Crossrefs
Programs
-
Mathematica
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; Table[If[PrimeQ[n],{PrimePi[n]},Differences[primeMS[n]]],{n,2,30}]
Formula
Row lengths are 1 or A001222(n) - 1 depending on whether n is prime.
Comments