login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173142 a(n) = n^n - (n-1)^(n-1) - (n-2)^(n-2) - ... - 1. 4
1, 3, 22, 224, 2837, 43243, 773474, 15903604, 369769661, 9594928683, 274906599294, 8620383706328, 293663289402069, 10799919901775579, 426469796631518922, 17997426089579351788, 808344199828497012733 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = 2*(n^n) - A001923(n), for n > 0. - Kritsada Moomuang, Feb 11 2019
EXAMPLE
1^1 - 0 = 1,
2^2 - 1 = 3,
3^3 - 2^2 - 1 = 22,
4^4 - 3^3 - 2^2 - 1 = 224, ...
MATHEMATICA
f[n_]:=n^n; lst={}; Do[a=f[n]; Do[a-=f[m], {m, n-1, 1, -1}]; AppendTo[lst, a], {n, 30}]; lst
Table[n^n -Sum[(n-k)^(n-k), {k, 1, n-1}], {n, 1, 20}] (* G. C. Greubel, Feb 11 2019 *)
PROG
(PARI) {a(n) = n^n - sum(k=1, n-1, (n-k)^(n-k))}; \\ G. C. Greubel, Feb 11 2019
(Magma) [n^n - (&+[(n-k)^(n-k): k in [1..n-1]]): n in [1..20]]; // G. C. Greubel, Feb 11 2019
(Sage) [n^n - sum((n-k)^(n-k) for k in (1..n-1)) for n in (1..20)] # G. C. Greubel, Feb 11 2019
CROSSREFS
Cf. A001923.
Sequence in context: A066573 A341476 A303190 * A073530 A120667 A196958
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 09:40 EDT 2024. Contains 370981 sequences. (Running on oeis4.)