login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A206913 Greatest binary palindrome <= n; the binary palindrome floor function. 77
0, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 9, 9, 9, 9, 15, 15, 17, 17, 17, 17, 21, 21, 21, 21, 21, 21, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 45, 45, 45, 45, 45, 45, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 63, 63, 65, 65, 65, 65 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Also the greatest binary palindrome < n + 1;

For n > 0, a(n-1) is the greatest binary palindrome < n.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

FORMULA

Let n > 2, p = 1 + 2*floor((n-1)/2), m = floor(log_2(p)), q = floor((m+1)/2), s = floor(log_2(p-2^q)),

F(x, r) = floor(x/2^q)*2^q + Sum_{k = 0...q - 1} (floor(x/2^(r-k)) mod 2)*2^k;

If F(p, m) <= n then a(n) = F(p, m), otherwise a(n) = F(p-2^q, s).

By definition: F(p, m) = floor(p/2^q)*2^q + A030101(p) mod 2^q; also: F(p-2^q, s) = floor((p-2^q)/2^q)*2^q + A030101(p-2^q) mod 2^q; [Edited and corrected by Hieronymus Fischer, Sep 08 2018]

a(n) = A006995(A206915(n));

a(n) = A006995(A206915(A206914(n+1))-1);

a(n) = A006995(A206916(A206914(n+1))-1).

EXAMPLE

a(0) = 0 since 0 is the greatest binary palindrome <= 0;

a(1) = 1 since 1 is the greatest binary palindrome <= 1;

a(2) = 1 since 1 is the greatest binary palindrome <= 2;

a(3) = 3 since 3 is the greatest binary palindrome <= 3.

PROG

(Haskell)

a206913 n = last $ takeWhile (<= n) a006995_list

-- Reinhard Zumkeller, Feb 27 2012

CROSSREFS

Cf. A006995, A206915, A206920, A030301.

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

Sequence in context: A129337 A133909 A177691 * A117767 A293701 A296063

Adjacent sequences:  A206910 A206911 A206912 * A206914 A206915 A206916

KEYWORD

nonn,base

AUTHOR

Hieronymus Fischer, Feb 13 2012

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 22:34 EDT 2019. Contains 328335 sequences. (Running on oeis4.)