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.

A253188 Minimal positive integer k such that n^n >= (n-k)^(n+k).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59
Offset: 1

Views

Author

Bui Quang Tuan, Mar 24 2015

Keywords

Examples

			a(4) = 1 because 4^4 = 256 > 243 = (4-1)^(4+1).
a(5) = 2 because 5^5 = 3125 > 2187 = (5-2)^(5+2) (but < 4096 = (5-1)^(5+1)).
		

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[n^n < (n - k)^(n + k), k++]; k]; Array[f, 120] (* Michael De Vlieger, Mar 24 2015 *)
  • PARI
    a(n) = {k = 1; npn = n^n; while(npn < (n-k)^(n+k), k++); k;} \\ Michel Marcus, Mar 24 2015