OFFSET
1,2
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 8 + 12*(n-2) + 6*((n-2)^2 - (n mod 2)) for n > 1, a(1) = 0.
G.f.: 4*x^2*(x^3-4*x^2-x-2)/((x+1)*(x-1)^3).
E.g.f.: 2*(2*(x - 2) + (3*x^2 - 3*x + 4)*cosh(x) + (3*x^2 - 3*x + 1)*sinh(x)). - Stefano Spezia, Feb 02 2023
EXAMPLE
The 2 X 2 X 2 Rubik's cube consists of 8 corner pieces, so a(2) = 8; the 3 X 3 X 3 cube has 8 corner pieces, 12 edge pieces, and 6 non-permutable center pieces, so a(3) = 8 + 12 = 20.
MATHEMATICA
LinearRecurrence[{2, 0, -2, 1}, {0, 8, 20, 56, 92}, 50] (* Paolo Xausa, Oct 04 2024 *)
PROG
(Python)
N = 20
seq = [0]
for n in range(2, N+1):
seq.append( 8 + 12*(n-2) + 6*((n-2)**2 - (n%2)) )
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
William Riley Barker, Jan 30 2023
STATUS
approved