The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A088698 Replace 1 with 11 in binary representation of n. 7
0, 3, 6, 15, 12, 27, 30, 63, 24, 51, 54, 111, 60, 123, 126, 255, 48, 99, 102, 207, 108, 219, 222, 447, 120, 243, 246, 495, 252, 507, 510, 1023, 96, 195, 198, 399, 204, 411, 414, 831, 216, 435, 438, 879, 444, 891, 894, 1791, 240, 483, 486, 975, 492, 987, 990 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
a(0)=0, a(2n) = 2a(n), a(2n+1) = 4a(n) + 3.
EXAMPLE
n=9: 1001 -> 110011 = 51, so a(9) = 51.
PROG
(PARI) a(n)=if(n<1, 0, if(n%2==0, 2*a(n/2), 4*a((n-1)/2)+3))
(Python)
def a(n): return int(bin(n)[2:].replace('1', '11'), 2)
print([a(n) for n in range(55)]) # Michael S. Branicky, Feb 20 2021
CROSSREFS
Ordered terms plus one are in A048297.
Same sequence sorted into ascending order: A277335, A290258 (without 0).
Main diagonal of A341520, right edge of A341521.
Sequence in context: A162276 A261955 A144615 * A105802 A285844 A285948
KEYWORD
nonn,easy,base
AUTHOR
Ralf Stephan, Oct 07 2003
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 12 16:52 EDT 2024. Contains 372492 sequences. (Running on oeis4.)