A317614 a(n) = (1/2)*(n^3 + n*(n mod 2)).
1, 4, 15, 32, 65, 108, 175, 256, 369, 500, 671, 864, 1105, 1372, 1695, 2048, 2465, 2916, 3439, 4000, 4641, 5324, 6095, 6912, 7825, 8788, 9855, 10976, 12209, 13500, 14911, 16384, 17985, 19652, 21455, 23328, 25345, 27436, 29679, 32000, 34481, 37044, 39775, 42592
Offset: 1
Examples
For n = 1 the matrix M(1) is 1 with trace Tr(M(1)) = a(1) = 1. For n = 2 the matrix M(2) is 1, 2 4, 3 with Tr(M(2)) = a(2) = 4. For n = 3 the matrix M(3) is 1, 2, 3 6, 5, 4 7, 8, 9 with Tr(M(3)) = a(3) = 15.
References
- Edward A. Ashcroft, Anthony A. Faustini, Rangaswami Jagannathan, and William W. Wadge, Multidimensional Programming, Oxford University Press 1995, p. 12.
- John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 64.
- G. Polya, Mathematics and Plausible Reasoning: Induction and analogy in mathematics, Princeton University Press 1990, p. 118.
- Shailesh Shirali, A Primer on Number Sequences, Universities Press (India) 2004, p. 106.
- James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.3 on pages 122-123.
Links
- Stefano Spezia, Table of n, a(n) for n = 0..10000
- Alfred Moessner, Eine Bemerkung über die Potenzen der natürlichen Zahlen, München 1952. Sitzungsberichte: 1951,3.
- Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
Crossrefs
Programs
-
GAP
a_n:=List([1..nmax], n->(1/2)*(n^3 + n*RemInt(n, 2)));
-
GAP
List([1..50],n->(1/2)*(n^3+n*(n mod 2))); # Muniru A Asiru, Aug 24 2018
-
Magma
[IsEven(n) select n^3/2 else (n^3+n)/2: n in [1..50]]; // Vincenzo Librandi, Aug 07 2018
-
Maple
a:=n->(1/2)*(n^3+n*modp(n,2)): seq(a(n),n=1..50); # Muniru A Asiru, Aug 24 2018
-
Mathematica
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}] CoefficientList[Series[-(1 + x^2)/((-1 + x)*(1 + x)^3), {x, 0, 45}], x]*Table[(k + 1)*(-1)^k, {k, 0, 45}] CoefficientList[Series[-(1 + x^2)/((-1 + x)^3*(1 + x)), {x, 0, 45}], x]*Table[(k + 1), {k, 0, 45}] From Robert G. Wilson v, Aug 01 2018: (Start) 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] CoefficientList[Series[(x^4 + 2x^3 + 6x^2 + 2x + 1)/((x - 1)^4 (x + 1)^2), {x, 0, 45}], x] LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 4, 15, 32, 65, 108}, 45] (End)
-
Maxima
a(n):=(1/2)*(n^3 + n*mod(n,2))$ makelist(a(n), n, 1, nmax);
-
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
-
PARI
M(i, j, n) = if (i % 2, j + n*(i-1), n*i - j + 1); a(n) = sum(k=1, n, M(k, k, n)); \\ Michel Marcus, Aug 07 2018
-
R
for (n in 1:nmax){ a <- (n^3+n*n%%2)/2 output <- c(n, a) cat(output, "\n") } (MATLAB and FreeMat) for(n=1:nmax); a=(n^3+n*mod(n,2))/2; fprintf('%d\t%0.f\n',n,a); end
Formula
a(n) = A006003(n) - (n/2)*(1 - (n mod 2)).
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)).
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).
L.g.f.: L(x) = -x*(1 + x^2)/((-1 + x)*(1 + x)^3).
H.l.g.f.: LH(x) = -x*(1 + x^2)/((-1 + x)^3*(1 + x)).
Dirichlet g.f.: (1/2)*(Zeta(-3 + s) + 2^(-s)*(-2 + 2^s)*Zeta(-1 + s)).
From Colin Barker, Aug 02 2018: (Start)
G.f.: x*(1 + 2*x + 6*x^2 + 2*x^3 + x^4) / ((1 - x)^4*(1 + x)^2).
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.
a(n) = n^3/2 for n even.
a(n) = (n^3+n)/2 for n odd. (End)
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
a(n) = A210378(n-1)/n. - Stefano Spezia, Jul 15 2024
Comments