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.
%I A350236 #30 Sep 30 2022 03:49:43 %S A350236 1,8,54,160,425,864,1666,2816,4617,7000,10406,14688,20449,27440,36450, %T A350236 47104,60401,75816,94582,116000,141561,170368,204194,241920,285625, %U A350236 333944,389286,450016,518897,594000,678466,770048,872289,982600,1104950,1236384,1381321 %N A350236 a(n) is the sum of the entries in an n X n X n 3D matrix whose elements start at 1 in the corner cells and increase by 1 with each step towards the center. %C A350236 The 2D version of this problem is discussed in A317614. %H A350236 Saeed Barari, <a href="/A350236/a350236.pdf">In depth (pdf)</a> %H A350236 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (2,2,-6,0,6,-2,-2,1). %F A350236 a(n) = (3/4)*n^2 * (n^2 - 2/3*n + (n mod 2)). %F A350236 From _Stefano Spezia_, May 19 2022: (Start) %F A350236 O.g.f.: x*(1 + 6*x + 36*x^2 + 42*x^3 + 45*x^4 + 12*x^5 + 2*x^6)/((1 - x)^5*(1 + x)^3). %F A350236 E.g.f.: x*((4 + 15*x + 16*x^2 + 3*x^3)*cosh(x) + (1 + 18*x + 16*x^2 + 3*x^3)*sinh(x))/4. %F A350236 a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5)- 2*a(n-6) - 2*a(n-7) + a(n-8) for n > 8. (End) %e A350236 For n=3: we have the following 3D matrix: (sliced for each Z surface) %e A350236 (z=1): 1 2 1 %e A350236 2 3 2 %e A350236 1 2 1 %e A350236 (z=2): 2 3 2 %e A350236 3 4 3 %e A350236 2 3 2 %e A350236 (z=3): 1 2 1 %e A350236 2 3 2 %e A350236 1 2 1 %e A350236 The sum of all elements is: (3/4)*n^2 * (n^2 - 2/3*n + (n mod 2)) = 54. %p A350236 a:=n->(3/4)*n^2 * (n^2 - (2/3)*n + modp(n, 2)): seq(a(n), n=1..50); %t A350236 LinearRecurrence[{2,2,-6,0,6,-2,-2,1},{1,8,54,160,425,864,1666,2816},35] (* _Stefano Spezia_, May 19 2022 *) %o A350236 (Python) %o A350236 for n in range(1, nmax): %o A350236 sum = round(3/4*n**2 * (n**2 - 2/3*n + n % 2)) %o A350236 print(sum, end=', ') %Y A350236 Cf. A317614. %K A350236 nonn,easy %O A350236 1,2 %A A350236 _Saeed Barari_, Dec 21 2021 %E A350236 Python program and a(23), a(34) corrected by _Georg Fischer_, Sep 30 2022