This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A057212 #32 Jul 02 2025 00:55:59 %S A057212 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, %T A057212 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, %U A057212 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 %N A057212 n-th run has length n. %C A057212 T(n,k) = 1 - n mod 2, 1 <= k <= n. [_Reinhard Zumkeller_, Mar 18 2011] %C A057212 {a(n)} interpreted as a string over {0,1} is one of exactly two fixed-points of the function defined by f(0^n 1 s) = 1^(n-1) f(1 s) and f(1^n 0 s) = 0^(n-1) f(0 s). The other fixed point is obtained by swapping all 0s and 1s. - _Curtis Bechtel_, Jun 27 2025 %D A057212 K. H. Rosen, Discrete Mathematics and its Applications, 1999, fourth edition, page 79, exercise 10 (g). %F A057212 a(n)=A003056(n) mod 2 so as a square array T(n, k)=n+k mod 2 - _Henry Bottomley_, Mar 22 2001 %F A057212 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 %F A057212 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 %F A057212 a(n) = 1 - A057211(n). - _Alois P. Heinz_, Oct 06 2021 %p A057212 A002024 := n->round(sqrt(2*n)):A057212 := n->(1+(-1)^A002024(n))/2; %p A057212 # alternative Maple program: %p A057212 T:= n-> [irem(1+n, 2)$n][]: %p A057212 seq(T(n), n=1..14); # _Alois P. Heinz_, Oct 06 2021 %t A057212 Table[If[OddQ[n], 0, 1], {n, 1, 14}, {n}] // Flatten (* _Jean-François Alcover_, Mar 07 2021 *) %o A057212 (Haskell) %o A057212 a057212 n = a057212_list !! (n-1) %o A057212 a057212_list = concat $ zipWith ($) (map replicate [1..]) a000035_list %o A057212 -- _Reinhard Zumkeller_, Mar 18 2011 %o A057212 (Python) %o A057212 from math import isqrt %o A057212 def A057212(n): return int(not isqrt(n<<3)+1&2) # _Chai Wah Wu_, Jun 19 2024 %Y A057212 Cf. A057211. %Y A057212 As a simple triangular or square array virtually the only sequences which appear are A000004, A000012 and A000035. Cf. A060510. %K A057212 easy,nonn,tabl %O A057212 1,1 %A A057212 Ben Tyner (tyner(AT)phys.ufl.edu), Sep 27 2000