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.

A317614 a(n) = (1/2)*(n^3 + n*(n mod 2)).

This page as a plain text file.
%I A317614 #180 Jul 27 2025 17:52:56
%S A317614 1,4,15,32,65,108,175,256,369,500,671,864,1105,1372,1695,2048,2465,
%T A317614 2916,3439,4000,4641,5324,6095,6912,7825,8788,9855,10976,12209,13500,
%U A317614 14911,16384,17985,19652,21455,23328,25345,27436,29679,32000,34481,37044,39775,42592
%N A317614 a(n) = (1/2)*(n^3 + n*(n mod 2)).
%C A317614 Terms are obtained as partial sums in an algorithm for the generation of the sequence of the fourth powers (A000583). Starting with the sequence of the positive integers (A000027), it is necessary to delete every 4th term and to consider the partial sums of the obtained sequence, then to delete every 3rd term, and lastly to consider again the partial sums (see References).
%C A317614 a(n) is the trace of an n X n square matrix M(n) formed by writing the numbers 1, ..., n^2 successively forward and backward along the rows in zig-zag pattern as shown in the examples below. Specifically, M(n) is defined as M[i,j,n] = j + n*(i-1) if i is odd and M[i,j,n] = n*i - j + 1 if i is even, and it has det(M(n)) = 0 for n > 2 (proved).
%C A317614 From _Saeed Barari_, Oct 31 2021: (Start)
%C A317614 Also the sum of the entries in an n X n matrix whose elements start from 1 and increase as they approach the center. For instance, in case of n=5, the entries of the following matrix sum to 65:
%C A317614   1 2 3 2 1
%C A317614   2 3 4 3 2
%C A317614   3 4 5 4 3
%C A317614   2 3 4 3 2
%C A317614   1 2 3 2 1. (End)
%C A317614 The n X n square matrix of the preceding comment is defined as: A[i,j,n] = n - abs((n + 1)/2 - j) - abs((n + 1)/2 - i). - _Stefano Spezia_, Nov 05 2021
%D A317614 Edward A. Ashcroft, Anthony A. Faustini, Rangaswami Jagannathan, and William W. Wadge, Multidimensional Programming, Oxford University Press 1995, p. 12.
%D A317614 John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 64.
%D A317614 G. Polya, Mathematics and Plausible Reasoning: Induction and analogy in mathematics, Princeton University Press 1990, p. 118.
%D A317614 Shailesh Shirali, A Primer on Number Sequences, Universities Press (India) 2004, p. 106.
%D A317614 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.3 on pages 122-123.
%H A317614 Stefano Spezia, <a href="/A317614/b317614.txt">Table of n, a(n) for n = 0..10000</a>
%H A317614 Alfred Moessner, <a href="https://publikationen.badw.de/de/003383662">Eine Bemerkung über die Potenzen der natürlichen Zahlen</a>, München 1952. Sitzungsberichte: 1951,3.
%H A317614 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F A317614 a(n) = (1/2)*(A000578(n) + n*A000035(n)).
%F A317614 a(n) = A006003(n) - (n/2)*(1 - (n mod 2)).
%F A317614 a(n) = Sum_{k=1..n} T(n,k), where T(n,k) = ((n + 1)*k - n)*(n mod 2) + ((n - 1)*k + 1)*(1 - (n mod 2)).
%F A317614 E.g.f.: E(x) = (1/4)*exp(-x)*x*(1 + 3*exp(2*x) + 6*exp(2*x)*x + 2*exp(2*x)*x^2).
%F A317614 L.g.f.: L(x) = -x*(1 + x^2)/((-1 + x)*(1 + x)^3).
%F A317614 H.l.g.f.: LH(x) = -x*(1 + x^2)/((-1 + x)^3*(1 + x)).
%F A317614 Dirichlet g.f.: (1/2)*(Zeta(-3 + s) + 2^(-s)*(-2 + 2^s)*Zeta(-1 + s)).
%F A317614 From _Colin Barker_, Aug 02 2018: (Start)
%F A317614 G.f.: x*(1 + 2*x + 6*x^2 + 2*x^3 + x^4) / ((1 - x)^4*(1 + x)^2).
%F A317614 a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
%F A317614 a(n) = n^3/2 for n even.
%F A317614 a(n) = (n^3+n)/2 for n odd. (End)
%F A317614 a(2*n) = A317297(n+1) + A001489(n). - _Stefano Spezia_, Dec 28 2018
%F A317614 Sum_{n>0} 1/a(n) = (1/2)*(-2*polygamma(0, 1/2) + polygamma(0, (1-i)/2)+ polygamma(0, (1+i)/2)) + zeta(3)/4 approximately equal to 1.3959168891658447368440622669882813003351669... - _Stefano Spezia_, Feb 11 2019
%F A317614 a(n) = (A000578(n) + A193356(n))/2. - _Stefano Spezia_, Jun 27 2022
%F A317614 a(n) = A210378(n-1)/n. - _Stefano Spezia_, Jul 15 2024
%e A317614 For n = 1 the matrix M(1) is
%e A317614   1
%e A317614 with trace Tr(M(1)) = a(1) = 1.
%e A317614 For n = 2 the matrix M(2) is
%e A317614   1, 2
%e A317614   4, 3
%e A317614 with Tr(M(2)) = a(2) = 4.
%e A317614 For n = 3 the matrix M(3) is
%e A317614   1, 2, 3
%e A317614   6, 5, 4
%e A317614   7, 8, 9
%e A317614 with Tr(M(3)) = a(3) = 15.
%p A317614 a:=n->(1/2)*(n^3+n*modp(n,2)): seq(a(n),n=1..50); # _Muniru A Asiru_, Aug 24 2018
%t A317614 CoefficientList[Series[1/4 E^-x (1 + 3 E^(2 x) + 6 E^(2 x) x + 2 E^(2 x) x^2), {x, 0, 45}], x]*Table[(k + 1)!, {k, 0, 45}]
%t A317614 CoefficientList[Series[-(1 + x^2)/((-1 + x)*(1 + x)^3), {x, 0, 45}], x]*Table[(k + 1)*(-1)^k, {k, 0, 45}]
%t A317614 CoefficientList[Series[-(1 + x^2)/((-1 + x)^3*(1 + x)), {x, 0, 45}], x]*Table[(k + 1), {k, 0, 45}]
%t A317614 From _Robert G. Wilson v_, Aug 01 2018: (Start)
%t A317614 a[i_, j_, n_] := If[OddQ@ i, j + n (i - 1), n*i - j + 1]; f[n_] := Tr[Table[a[i, j, n], {i, n}, {j, n}]]; Array[f, 45]
%t A317614 CoefficientList[Series[(x^4 + 2x^3 + 6x^2 + 2x + 1)/((x - 1)^4 (x + 1)^2), {x, 0, 45}], x]
%t A317614 LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 4, 15, 32, 65, 108}, 45]
%t A317614 (End)
%o A317614 (R)
%o A317614 for (n in 1:nmax){
%o A317614    a <- (n^3+n*n%%2)/2
%o A317614    output <- c(n, a)
%o A317614    cat(output, "\n")
%o A317614 }
%o A317614 (MATLAB and FreeMat)
%o A317614 for(n=1:nmax); a=(n^3+n*mod(n,2))/2; fprintf('%d\t%0.f\n',n,a); end
%o A317614 (GAP) a_n:=List([1..nmax], n->(1/2)*(n^3 + n*RemInt(n, 2)));
%o A317614 (Maxima) a(n):=(1/2)*(n^3 + n*mod(n,2))$ makelist(a(n), n, 1, nmax);
%o A317614 (PARI) Vec(x*(1 + 2*x + 6*x^2 + 2*x^3 + x^4) / ((1 - x)^4*(1 + x)^2) + O(x^40)) \\ _Colin Barker_, Aug 02 2018
%o A317614 (PARI) M(i, j, n) = if (i % 2, j + n*(i-1), n*i - j + 1);
%o A317614 a(n) = sum(k=1, n, M(k, k, n)); \\ _Michel Marcus_, Aug 07 2018
%o A317614 (Magma) [IsEven(n) select n^3/2 else (n^3+n)/2: n in [1..50]]; // _Vincenzo Librandi_, Aug 07 2018
%o A317614 (GAP) List([1..50],n->(1/2)*(n^3+n*(n mod 2))); # _Muniru A Asiru_, Aug 24 2018
%Y A317614 Cf. A000583, A000027, A186424 (first differences).
%Y A317614 Cf. A000578, A000035, A193356, A210378.
%Y A317614 Cf. A006003, A317297, A001489, A322844.
%Y A317614 Cf. related to the M matrices: A074147 (antidiagonals), A130130 (rank), A241016 (row sums), A317617 (column sums), A322277 (permanent), A323723 (subdiagonal sums), A323724 (superdiagonal sums).
%K A317614 nonn,easy
%O A317614 1,2
%A A317614 _Stefano Spezia_, Aug 01 2018