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.

A373662 a(n) = (1 + (n+1)^2 - (n-2)*(-1)^n)/2.

This page as a plain text file.
%I A373662 #28 Jun 24 2024 19:28:16
%S A373662 2,5,9,12,20,23,35,38,54,57,77,80,104,107,135,138,170,173,209,212,252,
%T A373662 255,299,302,350,353,405,408,464,467,527,530,594,597,665,668,740,743,
%U A373662 819,822,902,905,989,992,1080,1083,1175,1178,1274,1277,1377,1380,1484,1487,1595
%N A373662 a(n) = (1 + (n+1)^2 - (n-2)*(-1)^n)/2.
%C A373662 Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 2 of the boustrophedon-style array (see example).
%C A373662 In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=2.
%H A373662 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F A373662 a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
%F A373662 a(n) = A131179(n+1) + (-1)^n.
%F A373662 G.f.: -x*(2*x^4-3*x^3+3*x+2)/((x+1)^2*(x-1)^3). - _Alois P. Heinz_, Jun 12 2024
%e A373662        [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
%e A373662   [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
%e A373662   [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
%e A373662   [ 3]   6    8   13   19   24   34   39   53   58   76   ...
%e A373662   [ 4]   7   14   18   25   33   40   52   59   75   ...
%e A373662   [ 5]  15   17   26   32   41   51   60   74   ...
%e A373662   [ 6]  16   27   31   42   50   61   73   ...
%e A373662   [ 7]  28   30   43   49   62   72   ...
%e A373662   [ 8]  29   44   48   63   71   ...
%e A373662   [ 9]  45   47   64   70   ...
%e A373662   [10]  46   65   69   ...
%e A373662   [11]  66   68   ...
%e A373662   [12]  67   ...
%e A373662         ...
%t A373662 k := 2; Table[(1 + (n+k-1)^2 + (n-k) (-1)^(n+k-1))/2, {n, 80}]
%o A373662 (Magma) [(1 + (n+1)^2 - (n-2)*(-1)^n)/2: n in [1..80]];
%o A373662 (Python)
%o A373662 def A373662(n): return ((n+1)*(n+2)-1 if n&1 else n*(n+1)+5)>>1 # _Chai Wah Wu_, Jun 23 2024
%Y A373662 For rows k = 1..10: A131179 (k=1) n>0, this sequence (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).
%Y A373662 Cf. A001844, A038722.
%Y A373662 Row n=2 of A056011.
%Y A373662 Column k=2 of A056023.
%K A373662 nonn,easy
%O A373662 1,1
%A A373662 _Wesley Ivan Hurt_, Jun 12 2024