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!)
A030301 n-th run has length 2^(n-1). 9
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
FORMULA
a(n) = A000523(n) mod 2 = (A029837(n+1)+1) mod 2.
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 *)
Table[{PadRight[{}, 2^(n-1), 0], PadRight[{}, 2^n, 1]}, {n, 1, 8, 2}]//Flatten (* Harvey P. Dale, Apr 12 2023 *)
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
(Python)
def A030301(n): return n.bit_length()&1^1 # Chai Wah Wu, Jan 30 2023
CROSSREFS
Cf. A030300. Partial sums give A079954.
Characteristic function of A053754 (after its initial 0).
Sequence in context: A284789 A288736 A270803 * A316341 A284901 A071981
KEYWORD
nonn,base,easy
AUTHOR
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 26 11:23 EDT 2024. Contains 371997 sequences. (Running on oeis4.)