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!)
A361480 a(n) is the greatest integer whose binary expansion has the same multiset of run-lengths as that of n. 3
0, 1, 2, 3, 6, 5, 6, 7, 14, 13, 10, 13, 12, 13, 14, 15, 30, 29, 26, 27, 26, 21, 26, 29, 28, 27, 26, 27, 28, 29, 30, 31, 62, 61, 58, 59, 54, 53, 54, 59, 58, 53, 42, 53, 54, 53, 58, 61, 60, 59, 54, 51, 54, 53, 54, 59, 56, 59, 58, 59, 60, 61, 62, 63, 126, 125 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(a(n)) = a(n).
a(n) >= n.
PROG
(PARI) a(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r=vecsort(r); my (h=0, t=#r+1, v=0); for (k=1, #r, v=(v+k%2)*2^if (k%2, r[t--], r[h++])-k%2; ); return (v); }
CROSSREFS
Sequence in context: A345068 A057723 A335835 * A142151 A003968 A076734
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Mar 13 2023
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 August 11 02:58 EDT 2024. Contains 375059 sequences. (Running on oeis4.)