OFFSET
2,3
COMMENTS
A dual sequence toA179382.
Let b = (2*n-1) and k =A003558(n-1). If a(n) is odd, b divides (2^k + 1); but if a(n) is even, b divides (2^k - 1). Examples: a(14) = 5, odd; with b = 27 andA003558(13) = 9. Then 27 divides (2^9 + 1) or 513 = 27 * 19. a(18) = 6, even. b = 35, with k=A003558(17) = 12. Then 35 divides (2^12 - 1). -Gary W. Adamson,Aug 20 2012.
EXAMPLE
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.
MAPLE
Contribution fromR. 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:
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, afterR. J. Mathar*)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev,Jul 16 2010
EXTENSIONS
Edited byN. J. A. Sloane,Jul 18 2010
More terms fromR. J. Mathar,Nov 04 2010
STATUS
approved