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!)
A242872 Least number k > 1 such that (k^k-n^n)/(k-n) is an integer. 2
2, 3, 2, 2, 3, 2, 3, 2, 3, 4, 3, 3, 4, 2, 3, 4, 5, 6, 3, 2, 3, 2, 3, 4, 4, 6, 3, 4, 5, 3, 4, 8, 6, 4, 3, 4, 5, 2, 3, 4, 5, 3, 3, 2, 3, 4, 5, 6, 7, 8, 3, 4, 5, 4, 5, 2, 3, 4, 5, 5, 7, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 9, 10, 3, 4, 5, 6, 7, 8, 3, 4, 3, 4, 4, 2, 3, 4, 5, 6, 7, 8, 9, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) <= n-1 for n > 2 (since k > 1).
This is also the least number k such that (k^n-n^k)/(k-n) is an integer.
LINKS
EXAMPLE
(2^2-5^5)/(2-5) = 3121/3 is not an integer. (3^3-5^5)/(3-5) = 3098/2 = 1549 is an integer. Thus a(5) = 3.
MAPLE
A242872:= proc(n)
local nn, k;
nn:= n^n;
for k from 2 to n-1 do
if (nn-k^k) mod (n-k) = 0 then return k fi
od;
return n+1;
end:
seq(A242872(n), n=1..100); # Robert Israel, May 25 2014
MATHEMATICA
a[n_] := Switch[n, 1, 2, 2, 3, _, With[{nn = n^n}, For[k = 2, True, k++, If[Mod[nn-k^k, n-k] == 0, Return[k]]]]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 15 2023 *)
PROG
(PARI) a(n)=for(k=2, n+1, if(k!=n, s=(k^k-n^n)/(k-n); if(floor(s)==s, return(k))));
n=1; while(n<100, print(a(n)); n+=1)
CROSSREFS
Sequence in context: A333853 A182006 A085239 * A329362 A241604 A282900
KEYWORD
nonn
AUTHOR
Derek Orr, May 24 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 19 08:20 EDT 2024. Contains 371782 sequences. (Running on oeis4.)