login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #27 Jun 24 2024 19:43:31

%S 6,8,13,19,24,34,39,53,58,76,81,103,108,134,139,169,174,208,213,251,

%T 256,298,303,349,354,404,409,463,468,526,531,593,598,664,669,739,744,

%U 818,823,901,906,988,993,1079,1084,1174,1179,1273,1278,1376,1381,1483,1488,1594

%N a(n) = (1 + (n+2)^2 + (n-3)*(-1)^n)/2.

%C Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 3 of the boustrophedon-style array (see example).

%C In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=3.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).

%F a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).

%F a(n) = A373662(n+1) - (-1)^n.

%F G.f.: -x*(x^4+2*x^3-7*x^2+2*x+6)/((x+1)^2*(x-1)^3).

%e [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]

%e [ 1] 1 3 4 10 11 21 22 36 37 55 56 78 ...

%e [ 2] 2 5 9 12 20 23 35 38 54 57 77 ...

%e [ 3] 6 8 13 19 24 34 39 53 58 76 ...

%e [ 4] 7 14 18 25 33 40 52 59 75 ...

%e [ 5] 15 17 26 32 41 51 60 74 ...

%e [ 6] 16 27 31 42 50 61 73 ...

%e [ 7] 28 30 43 49 62 72 ...

%e [ 8] 29 44 48 63 71 ...

%e [ 9] 45 47 64 70 ...

%e [10] 46 65 69 ...

%e [11] 66 68 ...

%e [12] 67 ...

%e ...

%t k := 3; Table[(1 + (n+k-1)^2 + (n-k) (-1)^(n+k-1))/2, {n, 80}]

%o (Magma) [(1 + (n+2)^2 + (n-3)*(-1)^n)/2: n in [1..80]];

%o (Python)

%o def A373663(n): return ((n+1)*(n+2)+6 if n&1 else (n+2)*(n+3)-4)>>1 # _Chai Wah Wu_, Jun 23 2024

%Y For rows k = 1..10: A131179 (k=1) n>0, A373662 (k=2), this sequence (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), A374011 (k=10).

%Y Row 3 of the example in A056011, Column 3 of the rectangular array in A056023.

%K nonn,easy

%O 1,1

%A _Wesley Ivan Hurt_, Jun 12 2024