OFFSET
1,2
COMMENTS
Pure binary search with equality.
REFERENCES
Hsien-Kuei Hwang, S Janson, TH Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint, 2016; http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf. Also Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585
FORMULA
n + a_{floor((n-1)/2)} + a_{ceiling((n-1)/2)}.
EXAMPLE
a_5 = 9 = 5 + a_2 + a_2; this is the smallest example where choosing the middle value is not optimal.
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Franklin T. Adams-Watters, Aug 11 2004
STATUS
approved