login
A080526
Final entry in n-th row of triangle in A080524.
2
1, 3, 10, 67, 627, 7781, 117652, 2097159, 43046725, 1000000009, 25937424606, 743008370699, 23298085122487, 793714773254157, 29192926025390632, 1152921504606846991, 48661191875666868489, 2185911559738696531985
OFFSET
1,2
FORMULA
For odd n, a(n) = n^(n-1) + (n-1)/2; for even n, a(n) = n^(n-1) + n - 1. Alternatively, a(n) = n^(n-1) + (n-1)/(1 + (n mod 2)). - Max Alekseyev, Oct 23 2008
MATHEMATICA
Table[If[OddQ[n], n^(n-1)+(n-1)/2, n^(n-1)+n-1], {n, 20}] (* Harvey P. Dale, Oct 04 2020 *)
PROG
(PARI) { a(n) = n^(n-1)+(n-1)/(n%2 + 1) } \\ Max Alekseyev, Oct 23 2008
CROSSREFS
Sequence in context: A004102 A072638 A262843 * A359701 A308814 A342629
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 21 2003
EXTENSIONS
More terms and formula from Max Alekseyev, Oct 23 2008
STATUS
approved