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 A072939 #32 Apr 22 2025 03:46:49 %S A072939 3,7,9,11,15,19,23,25,27,31,33,35,39,41,43,47,51,55,57,59,63,67,71,73, %T A072939 75,79,83,87,89,91,95,97,99,103,105,107,111,115,119,121,123,127,129, %U A072939 131,135,137,139,143,147,151,153,155,159,161,163,167,169,171,175,179 %N A072939 Define a sequence c depending on n as follows: c(1)=1 and c(2)=n; c(k+2) = (c(k+1) + c(k))/2 if c(k+1) and c(k) have the same parity; otherwise c(k+2) = abs(c(k+1) - 2*c(k)); sequence gives values of n such that lim_{k->oo} c(k) = infinity. %C A072939 If c(2) is even then c(k) = 1 for k >= 2*c(2), hence there is no even value in the sequence. If n is in the sequence, there exist an integer k(n) and an integer m(n) such that, for any k >= k(n), c(2k) - c(2k-1) = 2*m(n) and c(2k+1) - c(2k) = -m(n). Sometimes m(n) = (n-1)/2 but not always. If B(n) = a(n+1) - a(n) then B(n) = 2 or 4, but B(n) does not seem to follow any pattern. %C A072939 Conjecture: a(n) = A036554(n)+1. - _Vladeta Jovovic_, Apr 01 2003 %C A072939 a(n) = A036554(n)+1 = A079523(n)+2. - _Ralf Stephan_, Jun 09 2003 %C A072939 Conjecture: this sequence gives the positions of 0's in the limiting 0-word of the morphism 0->11, 1->10, A285384. - _Clark Kimberling_, Apr 26 2017 %C A072939 Conjecture: This also gives the positions of the 1's in A328979. - _N. J. A. Sloane_, Nov 05 2019 %F A072939 Conjecture: lim_{n->oo} a(n)/n = 3. %e A072939 41 is in the sequence: if c(2)=41, then it follows that c(3)=21, c(4)=31, c(5)=26, c(6)=36, c(7)=31, c(8)=41, c(9)=36, ...; for k >= 2, c(2k) - c(2k-1) = 10 and c(2k+1) - c(2k) = -5, which implies that c(k) -> infinity. %o A072939 (Python) %o A072939 from itertools import count, islice %o A072939 def A072939_gen(startvalue=2): return filter(lambda n:(~(n-1)&(n-2)).bit_length()&1,count(max(startvalue,2))) # generator of terms >= startvalue %o A072939 A072939_list = list(islice(A072939_gen(),30)) # _Chai Wah Wu_, Jul 05 2022 %o A072939 (Python) %o A072939 def A072939(n): %o A072939 def bisection(f,kmin=0,kmax=1): %o A072939 while f(kmax) > kmax: kmax <<= 1 %o A072939 kmin = kmax >> 1 %o A072939 while kmax-kmin > 1: %o A072939 kmid = kmax+kmin>>1 %o A072939 if f(kmid) <= kmid: %o A072939 kmax = kmid %o A072939 else: %o A072939 kmin = kmid %o A072939 return kmax %o A072939 def f(x): %o A072939 c, s = n+x, bin(x)[2:] %o A072939 l = len(s) %o A072939 for i in range(l&1,l,2): %o A072939 c -= int(s[i])+int('0'+s[:i],2) %o A072939 return c %o A072939 return bisection(f,n,n)+1 # _Chai Wah Wu_, Jan 29 2025 %Y A072939 Cf. A036554, A079523, A285384, A328979. %K A072939 nonn %O A072939 1,1 %A A072939 _Benoit Cloitre_, Aug 12 2002