cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A173142 a(n) = n^n - (n-1)^(n-1) - (n-2)^(n-2) - ... - 1.

Original entry on oeis.org

1, 3, 22, 224, 2837, 43243, 773474, 15903604, 369769661, 9594928683, 274906599294, 8620383706328, 293663289402069, 10799919901775579, 426469796631518922, 17997426089579351788, 808344199828497012733
Offset: 1

Views

Author

Keywords

Examples

			1^1 - 0 = 1,
2^2 - 1 = 3,
3^3 - 2^2 - 1 = 22,
4^4 - 3^3 - 2^2 - 1 = 224, ...
		

Crossrefs

Cf. A001923.

Programs

  • Magma
    [n^n - (&+[(n-k)^(n-k): k in [1..n-1]]): n in [1..20]]; // G. C. Greubel, Feb 11 2019
    
  • 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 *)
  • PARI
    {a(n) = n^n - sum(k=1,n-1, (n-k)^(n-k))}; \\ 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

Formula

a(n) = 2*(n^n) - A001923(n), for n > 0. - Kritsada Moomuang, Feb 11 2019