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.

A291786 a(n) = number of iterations of k -> (psi(k)+phi(k))/2 (A291784) needed to reach a prime or a power of a prime or 1, or -1 if that doesn't happen.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 2, 1, 0, 0, 3, 0, 2, 2, 1, 0, 6, 0, 1, 0, 5, 0, 4, 0, 0, 9, 8, 7, 6, 0, 5, 4, 3, 0, 5, 0, 2, -1, 1, 0, -1, 0, -1, 6, 5, 0, 4, -1, -1, 2, 1, 0, -1, 0, 4, 3, 0, 3, 2, 0, -1, -1, -1, 0, -1, 0
Offset: 1

Views

Author

N. J. A. Sloane, Sep 02 2017

Keywords

Comments

Primes and prime powers are fixed points under the map f(k) = (psi(k)+phi(k))/2, so in that case we take a(n)=0. (If n = p^k, then psi(n) = p^k(1+1/p), phi(n) = p^k(1-1/p), and their average is p^k, so n is a fixed point under the map.)
Since f(n)>n if n is not a prime power, there can be no nontrivial cycles.
Wall (1985) observes that the trajectories of 45 and 50 are unbounded, so a(45) = a(50) = -1. See A291787, A291788.

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004. See Section B41, p. 147.

Crossrefs

Programs

  • PARI
    A291786(n,L=n)=n>1&&for(i=0,L,isprimepower(n)&&return(i);n=A291784(n));-(n>1) \\ The suggested search limit L=n is only empirical and might require revision. The code also currently assumes that the prime powers are the only cycles. - M. F. Hasler, Sep 03 2017

Formula

a(n) = 0 iff n is in A000961. - M. F. Hasler, Sep 03 2017

Extensions

Initial terms corrected and more terms from M. F. Hasler, Sep 03 2017