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!)
A103528 Sum_{k = 1..n-1 such that n == k (mod 2^k)} 2^(k-1). 4
0, 0, 1, 0, 1, 2, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8, 1, 2, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8, 17, 2, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8, 1, 2, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8, 17, 34, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8, 1, 2, 1, 0, 1, 2, 5, 0, 1, 2, 1, 0, 1, 2, 5, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
COMMENTS
Is there a simpler closed form?
LINKS
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers, J. Integer Seq. 8 (2005), no. 3, Article 05.3.6, 15 pp.
FORMULA
a(n) = (A102371(n) + n)/2 - 2^(n-1). - Philippe Deléham, Mar 27 2005
G.f.: Sum_{k>=1} 2^(k-1) x^(k+2^k)/(1 - x^(2^k)). - Robert Israel, Jan 21 2017
a(n) = (b(n) - b(n-1) - 1)/2 for n > 1 where b(n) = Sum_{k=0..A000523(n)} c(n-k, k) and c(n, m) = n - (n mod 2^m) with a(1) = 0. - Mikhail Kurkov, Jun 01 2022 [verification needed]
MAPLE
f:=proc(n) local t1, k; t1:=0; for k from 1 to n-1 do if n mod 2^k = k then t1:=t1+2^(k-1); fi; od: t1; end;
MATHEMATICA
(* b = A102371 (using Alex Ratushnyak's code) *)
b[n_] := b[n] = If[n == 1, 1, BitXor[b[n-1], b[n-1] + n]];
a[n_] := (b[n] + n)/2 - 2^(n-1);
Array[a, 100] (* Jean-François Alcover, Apr 11 2019, after Philippe Deléham *)
PROG
(PARI) a(n) = sum(k = 1, n-1, if ((n % 2^k) == k, 2^(k-1))); \\ Michel Marcus, May 06 2020
CROSSREFS
Cf. A102371.
Sequence in context: A276066 A145895 A114503 * A277239 A138352 A129620
KEYWORD
nonn,look,changed
AUTHOR
N. J. A. Sloane, Mar 22 2005
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 April 23 14:32 EDT 2024. Contains 371914 sequences. (Running on oeis4.)