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!)
A103185 a(n) = Sum_{ k >= 0 such that n + k == 0 mod 2^k } 2^(k-1). 6
0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 1, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 17, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 1, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 34, 17, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 1, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 17, 8, 5, 2, 1, 0, 1, 2, 1, 0, 5, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
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) = (A102370(n) - n)/2.
MATHEMATICA
f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[ Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^(k - 1)]; k++ ]; s]; Table[ f[n], {n, 0, 103}] (* Robert G. Wilson v, Mar 18 2005 *)
PROG
(PARI) A103185(n)=(sum(k=0, ceil(log(n+1)/log(2)), if((n+k)%2^k, 0, 2^k))-1)/2 \\ Benoit Cloitre, Mar 20 2005
(Python)
def a102370(n): return 0 if n<1 else sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)])
def a(n): return (a102370(n) - n)/2 # Indranil Ghosh, May 03 2017
CROSSREFS
Cf. A102370(n).
Sequence in context: A243821 A143445 A133727 * A130513 A114596 A083417
KEYWORD
nonn,easy,base
AUTHOR
N. J. A. Sloane, Mar 18 2005
EXTENSIONS
More terms from Robert G. Wilson v, Mar 18 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 July 7 18:16 EDT 2024. Contains 374112 sequences. (Running on oeis4.)