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!)
A259111 a(n) = least number k > 1 such that 1^k + 2^k + ... + k^k == n (mod k). 1

%I #14 Jul 02 2019 18:05:35

%S 2,4,2,8,2,3,2,16,2,4,2,3,2,4,2,32,2,3,2,5,2,4,2,3,2,4,2,7,2,3,2,64,2,

%T 4,2,3,2,4,2,5,2,3,2,8,2,4,2,3,2,4,2,8,2,3,2,7,2,4,2,3,2,4,2,128,2,3,

%U 2,8,2,4,2,3,2,4,2,8,2,3,2,5,2,4,2,3,2,4,2,11,2,3,2,8,2,4,2,3,2,4,2,5

%N a(n) = least number k > 1 such that 1^k + 2^k + ... + k^k == n (mod k).

%H Alois P. Heinz, <a href="/A259111/b259111.txt">Table of n, a(n) for n = 1..8192</a>

%F a(2^n) = 2^(n+1) for n >= 0.

%e Consider n=2:

%e Is k=2? 1^2 + 2^2 == 1 (mod 2). No.

%e Is k=3? 1^3 + 2^3 + 3^3 == 0 (mod 3). No.

%e Is k=4? 1^4 + 2^4 + 3^4 + 4^4 == 2 (mod 4). Yes. So a(2) = 4.

%e (Example corrected by _N. J. A. Sloane_, Jul 02 2019)

%p a:= proc(n) local k; for k from 2 while

%p add(i&^k mod k, i=1..k) mod k <> n mod k do od; k

%p end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Jun 18 2015

%t lnk[n_]:=Module[{k=2},While[Mod[Total[Range[k]^k],k]!=Mod[n,k],k++];k]; Array[ lnk,100] (* _Harvey P. Dale_, Jul 02 2019 *)

%o (PARI) vector(100,n,k=2;while(sum(i=1,k,i^k)!=Mod(n,k),k++);k)

%Y Cf. A014117, A226960-A226967.

%K nonn

%O 1,1

%A _Derek Orr_, Jun 18 2015

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 14:54 EDT 2024. Contains 371960 sequences. (Running on oeis4.)