login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A083741 a(n) = l(n) + a(l(n)), where l(n) = n - 2^floor(log2(n)) (A053645). 2
0, 0, 0, 1, 0, 1, 2, 4, 0, 1, 2, 4, 4, 6, 8, 11, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20, 23, 24, 27, 30, 34, 32, 35, 38, 42, 44, 48, 52, 57, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

COMMENTS

a(2^i)=0. Local extrema are a(2^i-1) = 2^i-i-1 (A000295).

LINKS

Table of n, a(n) for n=0..82.

J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197, ex. 24.

FORMULA

a(0)=0, a(1)=0, a(2n)=2a(n), a(4n+1)=2a(n)+a(2n+1), a(4n+3)=-2a(n)+3a(2n+1)+1.

MATHEMATICA

f[l_]:=Join[l, l-1+Range[Length[l]]]; Nest[f, {0}, 7] (* Ray Chandler, Jun 01 2010 *)

PROG

(PARI) a(n)=if(n<2, 0, if(n%2==0, 2*a(n/2), if(n%4==1, 2*a((n-1)/4)+a((n+1)/ 2), -2*a((n-3)/4)+3*a((n-3)/2+1)+1)))

CROSSREFS

Sequence in context: A074078 A309635 A130659 * A258761 A256245 A173004

Adjacent sequences:  A083738 A083739 A083740 * A083742 A083743 A083744

KEYWORD

easy,nonn

AUTHOR

Ralf Stephan, May 05 2003

EXTENSIONS

Extended by Ray Chandler, Mar 04 2010

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 February 25 12:28 EST 2021. Contains 341606 sequences. (Running on oeis4.)