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.

A160266 Let f and its k-fold iteration f^k be defined as in A159885. a(n) is the least k for which A006694( (f^k(2n+1)-1)/2 ) < A006694(n).

Original entry on oeis.org

2, 1, 1, 2, 4, 2, 1, 1, 6, 1, 2, 1, 1, 5, 1, 1, 1, 6, 1, 4, 3, 1, 2, 1, 1, 2, 1, 1, 10, 5, 1, 1, 8, 1, 1, 1, 1, 1, 2, 1, 40, 1, 1, 1, 1, 1, 6, 3, 1, 7, 17, 1, 36, 1, 1, 2, 1, 1, 1, 20, 1, 1, 1, 1, 8, 1, 1, 18, 13, 1, 5, 1, 2, 6, 1, 1, 1, 1, 1, 1, 6, 1, 9, 11, 2, 9, 1, 2, 9, 4, 6, 1, 1, 1, 9, 7, 1, 7, 29, 2, 2, 1
Offset: 1

Views

Author

Vladimir Shevelev, May 07 2009

Keywords

Comments

Conjecture. For every n>=1, there exists a finite value of a(n). It is easy to see that this conjecture is equivalent to the well known Collatz 3n+1 conjecture.

Crossrefs

Programs

  • Maple
    A006519 := proc(n) local i ; for i in ifactors(n)[2] do if op(1,i) = 2 then return op(1,i)^op(2,i) ; fi ; od: return 1 ; end proc:
    f := proc(twon1) local threen2 ; threen2 := 3*twon1/2+1/2 ; threen2/A006519(threen2) ; end proc:
    A160266 := proc(n) local ref,k,fk ; ref := A006694(n) ; k := 1 ; fk := f(2*n+1) ; while true do if A006694( (fk-1)/2 ) < ref then return k; end if; fk := f(fk) ; k := k+1 ; end do ; end proc:
    seq(A160266(n),n=1..120) ; # R. J. Mathar, Feb 02 2010
  • Mathematica
    A006519[n_] := Do[If[fi[[1]] == 2, Return[2^fi[[2]]], Return[1]], {fi, FactorInteger[n]}];
    f[n_] := With[{n2 = 3 n/2 + 1/2}, n2/A006519[n2]];
    A006694[n_] := Sum[EulerPhi[d]/MultiplicativeOrder[2, d], {d, Divisors[2n + 1]}] - 1;
    a[n_] := Module[{ref, k, fk}, ref = A006694[n]; k = 1; fk = f[2n + 1]; While[True, If[A006694[(fk - 1)/2] < ref, Return[k]]; fk = f[fk]; k++]];
    Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Aug 28 2024, after R. J. Mathar *)
  • PARI
    f(n) = ((3*((n-1)/2))+2)/A006519((3*((n-1)/2))+2);
    A006519(n) = (1<A006694(n) = (sumdiv(2*n+1, d, eulerphi(d)/znorder(Mod(2, d))) - 1); \\ From A006694
    A160266(n) = { my(w=A006694(n), n = (n+n+1), k=0); while(A006694((n-1)/2) >= w, k++; n = f(n)); (k); }; \\ Antti Karttunen, Sep 22 2018

Extensions

More terms from R. J. Mathar, Feb 02 2010