OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..214
FORMULA
For n>2, a(n) = n*A068792(n) + (n-1)(n^(2n-3) - 1).
For n>2, a(n) = 1 + n^(2n-2) + (n-1)n^(n-1) + Sum_{i=2..(n-2)} i*(n^(2n-2-i)+n^i).
MATHEMATICA
Join[{1, 5}, Table[1 + n^(2 n - 2) + (n - 1) n^(n - 1) + Sum[ i*(n^(2 n - 2 - i) + n^i), {i, 2, n - 2}], {n, 3, 50}]] (* G. C. Greubel, Oct 26 2017 *)
PROG
(PARI) for(n=1, 50, print1(if(n==1, 1, if(n==2, 5, 1 + n^(2*n - 2) + (n - 1)* n^(n - 1) + sum(i=2, n-2, i*(n^(2*n - 2 - i) + n^i)))), ", ")) \\ G. C. Greubel, Oct 26 2017
(Python)
def A123668(n): return n*((n**(n-1)-1)//(n-1))**2 + (n-1)*(n**(2*n-3)-1) if n>2 else 4*n-3 # Chai Wah Wu, Mar 18 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Franklin T. Adams-Watters, Nov 15 2006
STATUS
approved