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.

A097026 Function f(x) = phi(x) + floor(x/2) is iterated, starting at x=n; a(n) is the length of terminal cycle (or 0 if no finite cycle exists).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 4, 1, 1, 1, 2, 1, 4, 4, 2, 1, 4, 4, 2, 4, 2, 2, 6, 4, 2, 4, 6, 4, 2, 2, 6, 4, 6, 2, 1, 2, 6, 2, 6, 2, 1, 1, 6, 2, 6, 6, 6, 1, 2, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 1

Views

Author

Labos Elemer, Aug 27 2004

Keywords

Comments

While iteration of phi(x) always leads to a fixed point, f(x) = phi(x) + incr(x) may result in cycles or be divergent. What is the magnitude of the added incrementing function?
Some initial values are hard to analyze. The first is n=163, so perhaps a(163)=0 by definition.
Observation regarding the above comment: most n <= 1000 have 1 <= a(n) <= 12; the following have unresolved cycles at 10^3 iterations of f(x): {163, 182, 196, 243, 283, 331, 423, 487, 495, 503, 511, 523, 533, 551, 559, 571, 583, 591, 593, ...}. - Michael De Vlieger, May 16 2017

Examples

			n=70: iteration list = {70, 59, 87, 99, 109, 162, 135, 139, 207, 235, 301, 402, 333, 382, 381, 442, [413, 554, 553, 744, 612, 498], 413}, a(70)=6;
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 10^3}, Table[Count[Values@ PositionIndex@ NestList[EulerPhi@ # + Floor[#/2] &, n, nn], s_ /; Length@ s > 1], {n, 105}]] (* Michael De Vlieger, May 16 2017 *)
  • PARI
    findpos(newn, v) = {forstep(k=#v, 1, -1, if (v[k] == newn, return(k)););}
    a(n) = {ok = 0; v = [n]; while(!ok, newn = eulerphi(n) + n\2; ipos = findpos(newn, v); if (ipos, ok = 1; break); v = concat(v, newn); n = newn;); #v - ipos + 1;} \\ Michel Marcus, Jan 03 2017

Formula

For n=2^j: a(2^j)=1, powers of 2 are fixed points.