A179480 Let m>k>0 be odd numbers and denote by the symbol "m<->k" the value A000265(m-k). Then the sequence m<->k, m<->(m<->k), m<->(m<->(m<->k)), ... is periodic; a(n) is the smallest period in the case m=2*n-1, k=1.
1, 1, 2, 1, 3, 3, 2, 1, 5, 2, 6, 5, 5, 7, 2, 1, 6, 9, 6, 3, 3, 6, 12, 10, 4, 13, 10, 3, 15, 15, 2, 1, 17, 10, 18, 2, 10, 14, 20, 13, 21, 2, 14, 4, 6, 4, 18, 11, 9, 25, 26, 4, 27, 9, 18, 5, 22, 4, 12, 27, 10, 25, 2, 1, 33, 6, 18, 15, 35, 22, 30, 3, 22, 37, 6, 12, 10, 13, 26
Offset: 2
Keywords
Examples
If n=14, then m=27 and we have 27<->1=13, 27<->13=7, 27<->7=5, 27<->5=11, 27<->11=1. Thus a(14)=5.
Programs
-
Maple
Contribution from R. J. Mathar, Nov 04 2010: (Start) A179480aux := proc(x,y) local xtrack,xitr,xpos ; xtrack := [y] ; while true do xitr := A000265(x-op(-1,xtrack)) ; if not member(xitr, xtrack,'xpos') then xtrack := [op(xtrack),xitr] ; else return 1+nops(xtrack)-xpos ; end if; end do: end proc: A179480 := proc(n) A179480aux(2*n-1,1) ; end proc: seq(A179480(n),n=2..80) ; (End)
-
Mathematica
oddres[n_] := n/2^IntegerExponent[n, 2]; b[x_, y_] := Module[{xtrack = {y}, xitr}, While[True, xitr = oddres[x - Last@ xtrack]; If[FreeQ[xtrack, xitr], AppendTo[xtrack, xitr], Return[ Length[xtrack]]]]]; a[n_] := b[2n-1, 1]; a /@ Range[2, 80] (* Jean-François Alcover, Apr 13 2020, after R. J. Mathar *)
Extensions
Edited by N. J. A. Sloane, Jul 18 2010
More terms from R. J. Mathar, Nov 04 2010
Comments