OFFSET
1,1
COMMENTS
Inspired by multi-dimensional cubes: For n>1, the number of lattice points on the surface of a k-dimensional cube with side-length n is f(n,k) = n^k - (n-2)^k. a(n) = f(n,n).
EXAMPLE
For n = 2, a(n) = n^n - (n-2)^n = 2^2 - (2-2)^2 = 4.
MAPLE
MATHEMATICA
Array[#^# - (# - 2)^# &, {18}] (* Michael De Vlieger, Sep 10 2015 *)
PROG
(PARI) a(n) = n^n - (n-2)^n;
vector(40, n, a(n))
(Magma) [n^n - (n-2)^n : n in [1..20]]; // Wesley Ivan Hurt, Sep 10 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Sep 10 2015
STATUS
approved