login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A057212
n-th run has length n.
7
0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
OFFSET
1,1
COMMENTS
T(n,k) = 1 - n mod 2, 1 <= k <= n. [Reinhard Zumkeller, Mar 18 2011]
REFERENCES
K. H. Rosen, Discrete Mathematics and its Applications, 1999, fourth edition, page 79, exercise 10 (g).
FORMULA
a(n)=A003056(n) mod 2 so as a square array T(n, k)=n+k mod 2 - Henry Bottomley, Mar 22 2001
a(n) = (1+(-1)^A002024(n))/2, where A002024(n)=round(sqrt(2*n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 23 2003
a(n)=A163334(n) mod 2 = A163336(n) mod 2 = A163357(n) mod 2 = A163359(n) mod 2, i.e. the array gives the parity of elements at the successive antidiagonals (alternating between 0 and 1) of square arrays constructed from ANY Hilbert curve starting from zero located at the top left corner of a square grid (and using only N,E,S,W steps of length one). - Antti Karttunen, Oct 22 2012
a(n) = 1 - A057211(n). - Alois P. Heinz, Oct 06 2021
MAPLE
A002024 := n->round(sqrt(2*n)):A057212 := n->(1+(-1)^A002024(n))/2;
# alternative Maple program:
T:= n-> [irem(1+n, 2)$n][]:
seq(T(n), n=1..14); # Alois P. Heinz, Oct 06 2021
MATHEMATICA
Table[If[OddQ[n], 0, 1], {n, 1, 14}, {n}] // Flatten (* Jean-François Alcover, Mar 07 2021 *)
PROG
(Haskell)
a057212 n = a057212_list !! (n-1)
a057212_list = concat $ zipWith ($) (map replicate [1..]) a000035_list
-- Reinhard Zumkeller, Mar 18 2011
(Python)
from math import isqrt
def A057212(n): return int(not isqrt(n<<3)+1&2) # Chai Wah Wu, Jun 19 2024
CROSSREFS
Cf. A057211.
As a simple triangular or square array virtually the only sequences which appear are A000004, A000012 and A000035. Cf. A060510.
Sequence in context: A327256 A327177 A366255 * A023959 A341334 A076182
KEYWORD
easy,nonn,tabl
AUTHOR
Ben Tyner (tyner(AT)phys.ufl.edu), Sep 27 2000
STATUS
approved