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.

A322987 Number of iterations of A049820(x) = x - A000005(x) needed to reach a square, when starting from x = n.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 2, 3, 1, 0, 3, 1, 3, 2, 4, 2, 0, 3, 4, 4, 5, 4, 5, 5, 1, 0, 6, 6, 6, 7, 6, 8, 7, 8, 7, 9, 0, 10, 8, 10, 8, 11, 8, 12, 9, 11, 9, 12, 9, 0, 10, 13, 10, 14, 10, 14, 10, 15, 11, 16, 10, 17, 12, 16, 0, 18, 12, 19, 13, 19, 13, 20, 11, 21, 14, 20, 14, 22, 14, 23, 14, 0, 15, 1, 12, 1, 16, 2, 15, 3, 15, 3, 17, 4, 16, 4, 13, 5, 18, 5, 0
Offset: 0

Views

Author

Antti Karttunen, Jan 05 2019

Keywords

Crossrefs

Programs

  • PARI
    A322987(n) = if(issquare(n),0,1+A322987(n-numdiv(n)));
    
  • PARI
    A322987(n) = { for(j=0,oo,if(issquare(n),return(j)); n -= numdiv(n)); };

Formula

If A010052(n) == 1 [when n is in A000290], then a(n) = 0, otherwise a(n) = 1+a(A049820(n)).
a(n) <= A155043(n).
For n >= 83, a(2*n) = A322996(2*n)-1. [Note that 2*83 = 166 > 144 = A262514(2).]