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

 

Logo
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
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
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 19:04 EDT 2024. Contains 372203 sequences. (Running on oeis4.)