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.

A226939 A recursive variation of the Collatz-Fibonacci sequence: a(n) = 1 + min(a(C(n)),a(C(C(n)))) where C(n) = A006370(n), the Collatz map.

Original entry on oeis.org

1, 1, 4, 2, 3, 5, 9, 2, 10, 4, 8, 5, 5, 9, 9, 3, 7, 11, 11, 4, 4, 8, 8, 6, 12, 6, 56, 10, 10, 10, 54, 3, 14, 7, 7, 11, 11, 11, 18, 5, 55, 5, 15, 9, 9, 9, 53, 6, 13, 13, 13, 6, 6, 57, 57, 10, 17, 10, 17, 10, 10, 54, 54, 4, 14, 14, 14, 8, 8, 8
Offset: 1

Views

Author

Andres M. Torres, Jun 22 2013

Keywords

Comments

The sequence contains mysterious duplicates of terms, sometimes in groups of 2 to 4 at a time, but I haven't seen any cyclic patterns, it's all unique.

Examples

			a(n) values frequently depend on both lesser and higher terms:
a(3)= 1+ min( a(C(3)), a(C(C(3)))) = 4
a(3)= 1+ min( a(10), a(5))= 1+min(4,3) = 4
a(10)=1+ min( a(5), a(16))= 1+min(3,3) = 4
a(5) =1+ min( a(16),a(8)) = 1+min(3,2) = 3
a(16)=1+ min( a(8), a(4)) = 1+min(2,2) = 3
a(8) =1+ min( a(4), a(2)) = 1+min(1,1) = 2
a(4) =1+ min( a(2), a(1)) = 1+min(1,1) = 2
a(2) =1 (starting value)
		

Crossrefs

Cf. A014682.

Programs

  • Blitz3D
    function A(n)
                if n=1 or 2
                       return 1
                else
                       return 1 +lesser(A(C(n)), A(C(C(n))))
                end if
    end function
    ; The Collatz Sequence generator equation
    Function C(n)
           If n Mod 2
                     Return 3*n+1
           Else
                     Return n Shr 1
           End If
    End Function
    ;; Andres M. Torres, Jun 26 2013
  • PARI
    C(n)=if(n%2,3*n+1,n/2)
    A=vector(10^4);A[1]=A[2]=1;
    a(n)=if(n<=#A && A[n], A[n], my(c=C(n),t=min(a(c), a(C(c)))+1); if(n>#A, t, A[n]=t)) \\ Charles R Greathouse IV, Jun 24 2013
    

Formula

a(n) = 1 + min(a(C(n)), a(C(C(n)))), where C(n) = A006370(n).