cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329747 Runs-resistance of the sequence of prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

First differs from A304455 at a(90) = 3, A304455(90) = 4.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.
A prime index of n is a number m such that prime(m) divides n. The sequence of prime indices of n is row n of A112798.

Examples

			We have (1,2,2,3) -> (1,2,1) -> (1,1,1) -> (3), so a(90) = 3.
		

Crossrefs

The version for partitions is A329746.
The version for compositions is A329744.
The version for binary words is A329767.
The version for binary expansion is A318928.
Cf. A008578 (positions of 0's), A056239, A112798, A329745, A329750.

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