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.

A242789 Least number k > 1 such that (k^k-n)/(k-n) is an integer.

Original entry on oeis.org

2, 3, 2, 2, 3, 3, 3, 4, 3, 4, 3, 6, 4, 7, 3, 4, 5, 4, 7, 5, 5, 4, 7, 9, 4, 7, 3, 7, 5, 13, 5, 4, 9, 12, 5, 6, 10, 16, 9, 4, 9, 16, 7, 5, 5, 4, 10, 13, 7, 7, 11, 13, 5, 9, 7, 6, 5, 12, 19, 9, 11, 17, 7, 7, 5, 11, 4, 16, 9, 5, 11, 16, 9, 13, 15, 13, 9, 12, 7, 31, 6, 16, 5
Offset: 1

Views

Author

Derek Orr, May 22 2014

Keywords

Comments

a(n) <= n+1 for all n.

Examples

			(2^2-8)/(2-8) = -4/-6 is not an integer. (3^3-8)/(3-8) = 19/-5 is not an integer. (4^4-8)/(4-8) = 248/4 = 62 is an integer. Thus a(8) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 2}, While[k == n || ! Divisible[k^k - n, k - n], k++]; k]; Array[a, 100] (* Amiram Eldar, Jun 04 2021 *)
  • PARI
    a(n)=for(k=2,n+1,if(k!=n,s=(k^k-n)/(k-n);if(floor(s)==s,return(k))));
    n=1;while(n<100,print(a(n));n+=1)