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!)
A242789 Least number k > 1 such that (k^k-n)/(k-n) is an integer. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) <= n+1 for all n.
LINKS
EXAMPLE
(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.
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 *)
PROG
(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)
CROSSREFS
Sequence in context: A256170 A051686 A079294 * A366712 A366713 A076733
KEYWORD
nonn
AUTHOR
Derek Orr, May 22 2014
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 April 24 16:34 EDT 2024. Contains 371961 sequences. (Running on oeis4.)