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.

A279968 Square array read by antidiagonals upwards in which each term is the number of prior elements in the same row, column, diagonal, or antidiagonal whose parity is not the same as the parity of n.

Original entry on oeis.org

0, 0, 2, 0, 4, 0, 3, 1, 4, 2, 3, 3, 5, 3, 4, 2, 3, 5, 5, 4, 7, 2, 4, 5, 5, 6, 8, 3, 5, 4, 5, 10, 7, 7, 7, 7, 5, 5, 5, 9, 6, 12, 6, 8, 9, 4, 5, 8, 6, 6, 10, 9, 9, 7, 10, 4, 6, 8, 8, 5, 13, 9, 9, 12, 12, 8, 7, 6, 7, 8, 10, 9, 10, 12, 7, 11, 14, 9
Offset: 1

Views

Author

Alec Jones, Dec 24 2016

Keywords

Examples

			The first six terms of this array are:
.
0 2 0
0 4
0
.
a(8) = 1 because the parity of 8 is different from the parity of a(7) = 1.
a(3) = 2 because the parity of 3 is different from the parity of a(2) = 0 and a(1) = 0.
		

Crossrefs

Cf. A279965 for the related sequence which counts same-parity prior elements.
Cf. also A279211, A279212.

Programs

  • Haskell
    a279968 n = genericIndex a279968_list (n - 1)
    a279968_list = map count [1..] where
      count n = genericLength $ filter (odd . (n+)) adjacentLabels where
        adjacentLabels = map a279968 (a274080_row n)