The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A138575 Let H(1) = 0; B(0) = 0; H(n) = (n - B(n - 1)); B(n) = H(floor(n/2)); then a(n) = H(n) + B(n). 0
 1, 1, 1, 3, 5, 5, 8, 7, 9, 9, 10, 11, 13, 13, 13, 15, 17, 17, 18, 19, 21, 21, 23, 23, 25, 25, 26, 27, 29, 29 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,4 COMMENTS Dedicated to my high school teachers Mr. Hochhaus and Mr. Bacharach. LINKS Table of n, a(n) for n=0..29. Agoura High School, Home Page EXAMPLE H(4) = 4 - B(3); B(3) = 3 / 2 = 1 H(4) = 4 - 1 = 3. B(4) = 4 / 2 = 2. Therefore a(4) = H(4) + B(4) = 3 + 2 = 5. PROG (Java) static int Hochhaus(int n) { if (n < 0) return -1; if (n == 1) return 0; else return (n - Bacharach(n - 1)); } static int Bacharach(int n) { if (n < 0) return -1; if (n == 0) return 0; else return (Hochhaus(n/2)); } CROSSREFS Sequence in context: A197286 A019632 A021285 * A263209 A101330 A063285 Adjacent sequences: A138572 A138573 A138574 * A138576 A138577 A138578 KEYWORD nonn AUTHOR Andrew Bloom (ambloom_2006(AT)yahoo.com), May 12 2008 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 9 11:50 EDT 2024. Contains 375042 sequences. (Running on oeis4.)