cp's OEIS Frontend

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.

A060510 Alternating with hexagonal stutters: if n is hexagonal (2k^2 - k, i.e., A000384) then a(n)=a(n-1), otherwise a(n) = 1 - a(n-1).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 0

Views

Author

Henry Bottomley, Mar 22 2001

Keywords

Comments

The row sums equal A110654 and the alternating row sums equal A130472. - Johannes W. Meijer, Aug 12 2015
This is also the array:
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 ...
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 ...
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 ...
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 ...
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 ...
0 0 0 0 0 0 0 0 0 0 0 0 0 ...
...
read by antidiagonals. - N. J. A. Sloane, Mar 07 2023

Examples

			Hexagonal numbers start 1,6,15, ... so this sequence goes 0 0 (stutter at 1) 1 0 1 0 0 (stutter at 6) 1 0 1 0 1 0 1 0 0 (stutter at 15) 1 0, etc.
As a triangle, sequence begins:
0;
0, 1;
0, 1, 0;
0, 1, 0, 1;
0, 1, 0, 1, 0;
0, 1, 0, 1, 0, 1;
...
		

Crossrefs

As a simple triangular or square array virtually the only sequences which appear are A000004, A000012 and A000035.
Cf. A230135.

Programs

  • Maple
    T := proc(n, k): if k mod 2 = 1 then return(1) else return(0) fi: end: seq(seq(T(n, k), k=0..n), n=0..13);  # Johannes W. Meijer, Aug 12 2015
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[IntegerQ[(1+Sqrt[1+8(n+1)])/4],a,1-a]}; NestList[ nxt,{0,0},110][[All,2]] (* Harvey P. Dale, Jan 13 2022 *)
  • Python
    from math import isqrt
    def A060510(n): return n+1&1^1^((m:=isqrt(n+1<<3)+1>>1)*(m-1)>>1&1) # Chai Wah Wu, Oct 23 2024

Formula

a(n) = A002262(n) mod 2 = A060511(n) mod 2.
G.f.: x/(1-x^2) - (1+x)^(-1)*Sum(n>=1, x^(n*(2*n-1))). The sum is related to Theta functions. - Robert Israel, Aug 12 2015