A329747 Runs-resistance of the sequence of prime indices of n.
0, 0, 0, 1, 0, 2, 0, 1, 1, 2, 0, 3, 0, 2, 2, 1, 0, 3, 0, 3, 2, 2, 0, 3, 1, 2, 1, 3, 0, 2, 0, 1, 2, 2, 2, 2, 0, 2, 2, 3, 0, 2, 0, 3, 3, 2, 0, 3, 1, 3, 2, 3, 0, 3, 2, 3, 2, 2, 0, 4, 0, 2, 3, 1, 2, 2, 0, 3, 2, 2, 0, 3, 0, 2, 3, 3, 2, 2, 0, 3, 1, 2, 0, 4, 2, 2, 2, 3, 0, 3, 2, 3, 2, 2, 2, 3, 0, 3, 3, 2, 0, 2, 0, 3, 2, 2, 0, 3, 0, 2, 2, 3, 0, 2, 2, 3, 3, 2, 2, 4
Offset: 1
Keywords
Examples
We have (1,2,2,3) -> (1,2,1) -> (1,1,1) -> (3), so a(90) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Claude Lenormand, Deux transformations sur les mots, Preprint, 5 pages, Nov 17 2003.
- Index entries for sequences related to prime indices in the factorization of n.
Crossrefs
Programs
-
Mathematica
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1; Table[runsres[primeMS[n]],{n,50}]
-
PARI
pis_to_runs(n) = { my(runs=List([]), f=factor(n)); for(i=1,#f~,while(f[i,2], listput(runs,primepi(f[i,1])); f[i,2]--)); (runs); }; runlengths(lista) = if(!#lista, lista, if(1==#lista, List([1]), my(runs=List([]), rl=1); for(i=1, #lista, if((i< #lista) && (lista[i]==lista[i+1]), rl++, listput(runs,rl); rl=1)); (runs))); A329747(n) = { my(runs=pis_to_runs(n)); for(i=0,oo,if(#runs<=1, return(i), runs = runlengths(runs))); }; \\ Antti Karttunen, Jan 20 2025
Extensions
More terms from Antti Karttunen, Jan 20 2025
Comments