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.

A374004 a(n) = (1 + (n+3)^2 - (n-4)*(-1)^n)/2.

Original entry on oeis.org

7, 14, 18, 25, 33, 40, 52, 59, 75, 82, 102, 109, 133, 140, 168, 175, 207, 214, 250, 257, 297, 304, 348, 355, 403, 410, 462, 469, 525, 532, 592, 599, 663, 670, 738, 745, 817, 824, 900, 907, 987, 994, 1078, 1085, 1173, 1180, 1272, 1279, 1375, 1382, 1482, 1489, 1593
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 24 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 4 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=4.

Examples

			       [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
  [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
  [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
  [ 3]   6    8   13   19   24   34   39   53   58   76   ...
  [ 4]   7   14   18   25   33   40   52   59   75   ...
  [ 5]  15   17   26   32   41   51   60   74   ...
  [ 6]  16   27   31   42   50   61   73   ...
  [ 7]  28   30   43   49   62   72   ...
  [ 8]  29   44   48   63   71   ...
  [ 9]  45   47   64   70   ...
  [10]  46   65   69   ...
  [11]  66   68   ...
  [12]  67   ...
        ...
		

Crossrefs

For rows k = 1..10: A131179 (k=1) n>0, A373662 (k=2), A373663 (k=3), this sequence (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).
Row 4 of the table in A056011.
Column 4 of the rectangular array in A056023.

Programs

  • Magma
    [(1 + (n+3)^2 - (n-4)*(-1)^n)/2: n in [1..80]];
  • Mathematica
    CoefficientList[Series[-(7*x^4 - 7*x^3 - 10*x^2 + 7 x + 7)/((x + 1)^2*(x - 1)^3), {x, 0, 50}], x]
    k := 4; Table[(1 + (n+k-1)^2 + (n-k) (-1)^(n+k-1))/2, {n, 80}]

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: -x*(7*x^4-7*x^3-10*x^2+7x+7)/((x+1)^2*(x-1)^3).
a(n) = A373663(n+1) + (-1)^n.