OFFSET
1,1
LINKS
Daniel Suteu, Table of n, a(n) for n = 1..20
FORMULA
EXAMPLE
For a(3) = (3^(3+1)-(3-1)^3) + ((3+1)^3-3^(3-1)) = (3^4 - 2^3) + (4^3 - 3^2) = 128.
MATHEMATICA
Array[#^(# + 1) - (# - 1)^# + ((# + 1)^# - #^(# - 1)) &, 20] (* Vincenzo Librandi, May 29 2015 *)
PROG
(Sidef)
func a(n) {
((n+1)**n - n**(n-1)) -
((n-1)**n - n**(n+1))
};
1.to(Math.inf).each { |n|
say a(n);
};
(Magma) [(n^(n+1)-(n-1)^n) + ((n+1)^n-n^(n-1)): n in [1..20]]; // Vincenzo Librandi, May 29 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Suteu, May 28 2015
STATUS
approved