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.

A323073 Number of iterations of A049820(x) = x - A000005(x) needed to reach either zero or such x that x and A049820(x) are coprime, when starting from x = n.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 2, 0, 1, 3, 3, 0, 3, 0, 4, 0, 0, 0, 4, 0, 5, 0, 5, 0, 1, 0, 6, 0, 6, 0, 6, 0, 7, 0, 7, 0, 1, 0, 8, 0, 8, 0, 8, 0, 9, 1, 9, 0, 9, 0, 10, 0, 10, 0, 10, 0, 10, 0, 11, 0, 10, 0, 12, 1, 0, 0, 12, 0, 13, 0, 13, 0, 11, 0, 14, 1, 14, 0, 14, 0, 14, 0, 15, 0, 12, 0, 16, 0, 15, 0, 15, 0, 17, 0, 16, 0, 13, 0
Offset: 0

Views

Author

Antti Karttunen, Jan 05 2019

Keywords

Crossrefs

Cf. A046642 (positions of zeros after the initial a(0)=0).

Programs

  • PARI
    A323073(n) = if(!n,0,my(nn=(n-numdiv(n))); if(1==gcd(n,nn),0,1+A323073(nn)));
    
  • PARI
    A323073(n) = if(!n,0,for(j=0,oo,my(nn=(n-numdiv(n))); if((0==nn)||(1==gcd(n,nn)),return(j+(2==n)),n = nn)));

Formula

a(0) = 0; for n > 0, if A009191(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(n-A000005(n)).
a(n) <= A155043(n).