login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008687 Number of 1's in 2's complement representation of -n. 14
0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

a(A127904(n)) = n and a(m) < n for m < A127904(n). - Reinhard Zumkeller, Feb 05 2007

a(n) = A000120(A010078(n)), n>0; a(n) = A023416(A004754(n-1)), n>1. - Reinhard Zumkeller, Dec 04 2015

LINKS

R. Zumkeller, Table of n, a(n) for n = 0..10000

Michael Gilleland, Some Self-Similar Integer Sequences

Wikipedia, Two's complement

FORMULA

a(n) = if n<=1 then n else (n mod 2) + a((n mod 2) + floor(n/2)). - Reinhard Zumkeller, Feb 05 2007

a(n) = if n<2 then n else a(ceiling(n/2)) + n mod 2. - Reinhard Zumkeller, Jul 25 2006

Min{m: a(m)=n} = if n>0 then A083318(n-1) else 0. - Reinhard Zumkeller, Jul 25 2006

MATHEMATICA

a[0] = 0; a[1] = 1; a[n_] := a[n] = Mod[n, 2] + a[Mod[n, 2] + Floor[n/2]]; Array[a, 96, 0] (* Jean-Fran├žois Alcover, Aug 12 2017, after Reinhard Zumkeller *)

PROG

(Haskell)

a008687 n = a008687_list !! n

a008687_list = 0 : 1 : c [1] where c (e:es) = e : c (es ++ [e+1, e])

-- Reinhard Zumkeller, Mar 07 2011

CROSSREFS

A023416(n-1) + 1.

This is Guy Steele's sequence GS(4, 3) (see A135416).

Cf. A000120, A004754, A010078, A023416, A290251.

Sequence in context: A175548 A038571 A290251 * A080801 A124758 A198328

Adjacent sequences:  A008684 A008685 A008686 * A008688 A008689 A008690

KEYWORD

nonn,base

AUTHOR

R. H. Hardin

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 21 10:49 EST 2019. Contains 320372 sequences. (Running on oeis4.)