OFFSET
1,1
COMMENTS
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.
Conjecture: a(n) = A036554(n)+1. - Vladeta Jovovic, Apr 01 2003
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
Conjecture: This also gives the positions of the 1's in A328979. - N. J. A. Sloane, Nov 05 2019
FORMULA
Conjecture : lim_{n->oo} a(n)/n = 3.
EXAMPLE
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.
PROG
(Python)
from itertools import count, islice
def A072939_gen(startvalue=2): return filter(lambda n:(~(n-1)&(n-2)).bit_length()&1, count(max(startvalue, 2))) # generator of terms >= startvalue
(Python)
def A072939(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
kmin = kmax >> 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x):
c, s = n+x, bin(x)[2:]
l = len(s)
for i in range(l&1, l, 2):
c -= int(s[i])+int('0'+s[:i], 2)
return c
return bisection(f, n, n)+1 # Chai Wah Wu, Jan 29 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 12 2002
STATUS
approved