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.
3, 7, 9, 11, 15, 19, 23, 25, 27, 31, 33, 35, 39, 41, 43, 47, 51, 55, 57, 59, 63, 67, 71, 73, 75, 79, 83, 87, 89, 91, 95, 97, 99, 103, 105, 107, 111, 115, 119, 121, 123, 127, 129, 131, 135, 137, 139, 143, 147, 151, 153, 155, 159, 161, 163, 167, 169, 171, 175, 179
Offset: 1
Keywords
Examples
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.
Programs
-
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 A072939_list = list(islice(A072939_gen(),30)) # Chai Wah Wu, Jul 05 2022
-
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
Formula
Conjecture: lim_{n->oo} a(n)/n = 3.
Comments