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 A179738 #32 Feb 21 2025 07:59:51 %S A179738 1,2,4,1,4,8,2,4,8,4,2,2,1,4,12,4,4,26,2,12,6,2,4,4,4,16,4,8,10,6,4,8, %T A179738 4,2,6,8,12,12,28,1,22,16,2,16,12,12,16,6,4,40,24,4,32,6,26,16,6,8,4, %U A179738 8,12,2,36,6,46,12,2,36,60,6,16,8,4,18,20,4,60,36 %N A179738 a(n) = length of (eventual) period of the sequence defined by s(0) = 1, s(n+1) = odd_part(2n-1 + (s(n) if n odd else s(n)*3)), where odd_part = A000265. %C A179738 Original definition (edited): Let x, y be odd numbers and the operation x <+> y := A000265(x+y). Consider sequence s(0) = x <+> y, s(2*k+1) = x <+> 3*s(2*k), s(2*k+2) = x <+> s(2*k+1); a(n) is the smallest period in case x = 2*n-1, y = 1. %C A179738 The operation x <+> y = A000265(x+y) = odd part of x+y is also considered in A179382. %C A179738 Record values are: a(2) = 1, a(3) = 2, a(4) = 4, a(7) = 8, a(16) = 12, a(19) = 26, a(40) = 28, a(51) = 40, a(66) = 46, a(70) = 60, a(111) = 64, a(126) = 70, a(147) = 80, a(162) = 96, a(225) = 120, a(379) = 170, a(619) = 184, a(640) = 228, a(727) = 248, a(759) = 256, a(916) = 348, ... - _M. F. Hasler_, Feb 16 2025 %H A179738 Jason Yuen, <a href="/A179738/b179738.txt">Table of n, a(n) for n = 2..10000</a> (terms 2..1000 from M. F. Hasler) %e A179738 For n = 4, 2*n-1 = 7, we get: 7 <+> 1 = 1, 7 <+> 3*1 = 5, 7 <+> 5 = 3, 7 <+> 3*3 = 1, and from here on it starts over with 7 <+> 1 = 1, etc., so the period is [1, 5, 3, 1], of length 4, whence a(4) = 4. %e A179738 For n = 6, 2*n-1 = 11, we get: %e A179738 11 <+> 1 = 3, 11 <+> 3*3 = 5, 11 <+> 5 = 1, 11 <+> 3*1 = 7, %e A179738 11 <+> 7 = 9, 11 <+> 3*9 = 19, 11 <+> 19 = 15, 11 <+> 3*15 = 7, 11 <+> 7 = 9, ... %e A179738 Thus we have an eventually periodic sequence with the smallest period 4 (with elements 7, 9, 19, 15). Thus a(6) = 4. %o A179738 (PARI) apply( {A179738(n, y=1, T(y, x=2*n-1)=(x+y)>>valuation(x+y,2))=my(s=[], P); until(, s=concat(s, y=T(3^(#s%2)*y)); for(L=1, #s\3, P=[vecextract(s,Str(-L-t,"..-",1+t)) | t<-[0,L,2*L]]; P[1]==P[2] && P[1]==P[3] && return(#P[1])))}, [2..90]) %o A179738 (Python) %o A179738 def A179738(n): %o A179738 s = [1]; x = 2*n-1; odd = lambda z: all(z&1 or(z:=z>>1)for _ in range(z))and z %o A179738 while not(p := next((p for p in range(1, len(s)//3+1) if %o A179738 s[-p:]==s[-2*p:-p]==s[-3*p:-2*p]), 0)): s.append(odd(x+3**(len(s)&1)*s[-1])) %o A179738 return p %o A179738 print([A179738(n)for n in range(2,99)]) # _M. F. Hasler_, Feb 16 2025 %Y A179738 Cf. A179382, A179480, A179686. %K A179738 nonn %O A179738 2,2 %A A179738 _Vladimir Shevelev_, Jul 25 2010 %E A179738 Name edited and corrections proposed by _Jason Yuen_, Feb 09 2025 %E A179738 Edited, a(4) and a(18) corrected, and extended by _M. F. Hasler_, Feb 15 2025