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.

A304487 a(n) = (3 + 2*n - 3*n^2 + 4*n^3 - 3*((-1 + n) mod 2))/6.

This page as a plain text file.
%I A304487 #77 Dec 05 2024 11:40:09
%S A304487 1,4,15,36,73,128,207,312,449,620,831,1084,1385,1736,2143,2608,3137,
%T A304487 3732,4399,5140,5961,6864,7855,8936,10113,11388,12767,14252,15849,
%U A304487 17560,19391,21344,23425,25636,27983,30468,33097,35872,38799,41880,45121,48524,52095
%N A304487 a(n) = (3 + 2*n - 3*n^2 + 4*n^3 - 3*((-1 + n) mod 2))/6.
%C A304487 a(n) is the trace of an n X n matrix A in which the entries are 1 through n^2, spiraling inward starting with 1 in the (1,1)-entry (proved).
%C A304487 The first three terms of a(n) coincide with those of A317614.
%H A304487 Stefano Spezia, <a href="/A304487/b304487.txt">Table of n, a(n) for n = 1..10000</a>
%H A304487 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).
%F A304487 a(n) = A045991(n) - Sum_{k=2..n-1} A085046(k) for n > 2 (proved).
%F A304487 G.f.: x*(1 + x + 5 x^2 + x^3)/((-1 + x)^4 (1 + x)).
%F A304487 a(n) + a(n + 1) = A228958(2*n + 1).
%F A304487 From _Colin Barker_, Aug 17 2018: (Start)
%F A304487 a(n) = (2*n - 3*n^2 + 4*n^3) / 6 for n even.
%F A304487 a(n) = (3 + 2*n - 3*n^2 + 4*n^3) / 6 for n odd.
%F A304487 a(n) = 3*a(n - 1) - 2*a(n - 2) - 2*a(n - 3) + 3*a(n - 4) - a(n - 5) for n > 5.
%F A304487 (End)
%F A304487 E.g.f.: (1/12)*exp(-x)*(-3 + exp(2*x)*(3 + 6*x + 18*x^2 + 8*x^3)). - _Stefano Spezia_, Feb 10 2019
%e A304487 For n = 1 the matrix A is
%e A304487    1
%e A304487 with trace Tr(A) = a(1) = 1.
%e A304487 For n = 2 the matrix A is
%e A304487    1, 2
%e A304487    4, 3
%e A304487 with Tr(A) = a(2) = 4.
%e A304487 For n = 3 the matrix A is
%e A304487    1, 2, 3
%e A304487    8, 9, 4
%e A304487    7, 6, 5
%e A304487 with Tr(A) = a(3) = 15.
%e A304487 For n = 4 the matrix A is
%e A304487    1,  2,  3, 4
%e A304487   12, 13, 14, 5
%e A304487   11, 16, 15, 6
%e A304487   10,  9,  8, 7
%e A304487 with Tr(A) = a(4) = 36.
%p A304487 seq((3+2*n-3*n^2+4*n^3-3*modp((-1+n),2))/6,n=1..43); # _Muniru A Asiru_, Sep 17 2018
%t A304487 Table[1/6 (3 + 2 n - 3 n^2 + 4 n^3 - 3 Mod[-1 + n, 2]), {n, 1, 43}] (* or *)
%t A304487 CoefficientList[ Series[x*(1 + x + 5 x^2 + x^3)/((-1 + x)^4 (1 + x)), {x, 0, 43}], x] (* or *)
%t A304487 LinearRecurrence[{3, -2, -2, 3, -1}, {1, 4, 15, 36, 73}, 43]
%o A304487 (MATLAB and FreeMat)
%o A304487 for(n=1:43); tm=(3 + 2*n - 3*n^2 + 4*n^3 - 3*mod(-1 + n, 2))/6; fprintf('%d\t%0.f\n', n, tm); end
%o A304487 (GAP)
%o A304487 a_n:=List([1..43], n->(3 + 2*n - 3*n^2 + 4*n^3 - 3*RemInt(-1 + n, 2))/6);
%o A304487 (Maxima)
%o A304487 a(n):=(3 + 2*n - 3*n^2 + 4*n^3 - 3*mod(-1 + n, 2))/6$ makelist(a(n), n, 1, 43);
%o A304487 (PARI) Vec(x*(1 + x + 5*x^2 + x^3)/((-1 + x)^4*(1 + x)) + O(x^44))
%o A304487 (PARI) a(n) = (3 + 2*n - 3*n^2 + 4*n^3 - 3*((-1 + n)%2))/6
%o A304487 (Magma) I:=[1,4,15,36,73]; [n le 5 select I[n] else 3*Self(n-1)-2*Self(n-2)-2*Self(n-3)+3*Self(n-4)-Self(n-5): n in [1..43]]; // _Vincenzo Librandi_, Aug 26 2018
%o A304487 (GAP) List([1..43],n->(3+2*n-3*n^2+4*n^3-3*((-1+n) mod 2))/6); # _Muniru A Asiru_, Sep 17 2018
%Y A304487 Cf. A317614, A228958, A045991, A085046.
%Y A304487 Cf. A126224 (determinant of the matrix A), A317298 (first differences).
%K A304487 nonn,easy
%O A304487 1,2
%A A304487 _Stefano Spezia_, Aug 17 2018