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.
%I A179686 #8 May 11 2019 17:31:38 %S A179686 1,2,4,2,2,2,4,2,6,4,4,6,8,6,4,2,4,10,4,6,2,4,12,12,4,14,12,2,14,14,4, %T A179686 2,18,12,16,4,8,16,16,14,18,4,12,4,4,4,20,10,6,22,24,4,26,6,16,6,20,4, %U A179686 12,26,8,22,4,2,34,8,20,14,34,24,32,6,20,42,4,12,8,10,24 %N A179686 Let m > k > 0 be odd numbers and operations "m<+>k" and "m<->k" be defined as in A179382 and A179480. Then the sequence m<+>k, m<->(m<+>k), m<+>(m<->(m<+>k)), ... is periodic; a(n) is its smallest period starting from the seeds m=2*n-1 and k=1. %e A179686 If n=4, 2*n-1=7, then we have 7<+>1=1, 7<->1=3, 7<+>3=5, 7<->5=1. Thus a(4)=4. %p A179686 pidx := proc(L,n,m) %p A179686 for i from 1 to nops(L)-1 do %p A179686 if [op(i..i+1,L)] = [n,m] then %p A179686 return i; %p A179686 end if; %p A179686 end do: %p A179686 return -1 ; %p A179686 end proc: %p A179686 A179686aux := proc(x, y) local xtrack, xitr, p; %p A179686 xtrack := [A000265(x+y)] ; %p A179686 while true do %p A179686 if type(nops(xtrack),'odd') then %p A179686 xitr := A000265(x-op(-1, xtrack)) ; %p A179686 else %p A179686 xitr := A000265(x+op(-1, xtrack)) ; %p A179686 end if; %p A179686 xtrack := [op(xtrack),xitr] ; %p A179686 p := pidx(xtrack,op(-2,xtrack),op(-1,xtrack)) ; %p A179686 if p >=1 and p < nops(xtrack) -2 then %p A179686 return nops(xtrack)-p-1 ; %p A179686 end if; %p A179686 end do: %p A179686 end proc: %p A179686 A179686 := proc(n) %p A179686 if n = 2 then %p A179686 1; %p A179686 else %p A179686 A179686aux(2*n-1,1) ; %p A179686 end if; %p A179686 end proc: %p A179686 seq(A179686(n),n=2..80) ; # _R. J. Mathar_, Dec 04 2011 %Y A179686 Cf. A179382, A179480. %K A179686 nonn %O A179686 2,2 %A A179686 _Vladimir Shevelev_, Jul 24 2010 %E A179686 Extended beyond a(24) by _R. J. Mathar_, Dec 04 2011