A352823 Number of nonfixed points y(i) != i, where y is the weakly increasing sequence of prime indices of n.
0, 0, 1, 1, 1, 0, 1, 2, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 2, 2, 1, 0, 1, 4, 2, 1, 2, 3, 1, 1, 2, 3, 1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 3, 1, 1, 2, 5, 2, 1, 1, 2, 2, 2, 1, 4, 1, 1, 2, 2, 2, 1, 1, 4, 3, 1, 1, 2, 2, 1, 2, 3, 1, 2, 2, 2, 2, 1, 2, 5, 1, 2, 2, 2, 1, 1, 1, 3, 3
Offset: 1
Keywords
Examples
The prime indices of 6500 are {1,1,3,3,3,6}, with nonfixed points at positions {2,4,5}, so a(6500) = 3.
Crossrefs
Programs
-
Mathematica
pnq[y_]:=Length[Select[Range[Length[y]],#!=y[[#]]&]]; Table[pnq[If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]],{n,100}]
-
PARI
A352823(n) = { my(f=factor(n),i=0,c=0); for(k=1,#f~,while(f[k,2], f[k,2]--; i++; c += (i!=primepi(f[k,1])))); (c); }; \\ Antti Karttunen, Apr 11 2022
Formula
Extensions
Data section extended up to 105 terms by Antti Karttunen, Apr 11 2022
Comments