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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080116 Characteristic function of A014486. a(n) = 1 if n's binary expansion is totally balanced, otherwise zero. 6
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

LINKS

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

Index entries for characteristic functions

MAPLE

A080116 := proc(n) local c, lev; lev := 0; c := n; while(c > 0) do lev := lev + (-1)^c; c := floor(c/2); if(lev < 0) then RETURN(0); fi; od; if(lev > 0) then RETURN(0); else RETURN(1); fi; end;

MATHEMATICA

A080116[n_] := (lev = 0; c = n; While[c > 0, lev = lev + (-1)^c; c = Floor[c/2]; If[lev < 0, Return[0]]]; If[lev > 0, Return[0], Return[1]]); Table[A080116[n], {n, 0, 104}] (* Jean-Fran├žois Alcover, Jul 24 2013, translated from Maple *)

PROG

(Sage)

def A080116(n) :

    lev = 0

    while n > 0 :

        lev += (-1)^n

        if lev < 0: return 0

        n = n//2

    return 0 if lev > 0 else 1

[A080116(n) for n in (0..104)] # Peter Luschny, Aug 09 2012

CROSSREFS

Cf. A080110-A080111.

Sequence in context: A016391 A016378 A089805 * A016359 A014029 A016396

Adjacent sequences:  A080113 A080114 A080115 * A080117 A080118 A080119

KEYWORD

nonn

AUTHOR

Antti Karttunen Feb 11 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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 14:35 EDT 2018. Contains 316263 sequences. (Running on oeis4.)