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

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A030301 n-th run has length 2^(n-1). 8
0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65537

Index entries for sequences related to binary expansion of n

Index entries for characteristic functions

FORMULA

a(n) = 0 iff n has an odd number of digits in binary, = 1 otherwise. - Henry Bottomley, Apr 06 2000

a(n) = (1/2)*{1-(-1)^floor(log(n)/log(2))}. - Benoit Cloitre, Nov 22 2001

a(n) = 1-a(floor(n/2)). - Vladeta Jovovic, Aug 04 2003

a(n) = 1 - A030300(n). - Antti Karttunen, Oct 10 2017

MATHEMATICA

nMax = 7; Table[1 - Mod[n, 2], {n, nMax}, {2^(n-1)}] // Flatten (* Jean-Fran├žois Alcover, Oct 20 2016 *)

PROG

(PARI) a(n)=if(n<1, 0, 1-length(binary(n))%2)

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

(MAGMA) [Floor(Log(n)/Log(2)) mod 2: n in [1..100]]; // Vincenzo Librandi, Jun 23 2015

CROSSREFS

a(n) = A000523(n) mod 2 = (A029837(n+1)+1) mod 2.

Cf. A030300. Partial sums give A079954.

Characteristic function of A053754 (after its initial 0).

Sequence in context: A171386 A125720 A095130 * A093692 A105384 A057212

Adjacent sequences:  A030298 A030299 A030300 * A030302 A030303 A030304

KEYWORD

nonn,base,easy

AUTHOR

Jean-Paul Delahaye (Jean-Paul.Delahaye(AT)lifl.fr)

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 November 20 00:42 EST 2017. Contains 294957 sequences.