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!)
A117131 Remainder when n^n is divided by the n-th prime number. 2

%I #21 Sep 08 2022 08:45:24

%S 1,1,2,4,1,12,12,7,2,6,24,26,11,6,30,15,9,41,39,32,51,64,78,4,72,43,

%T 89,25,31,109,26,62,80,36,9,72,132,140,105,52,132,135,117,147,79,193,

%U 93,49,175,76,64,187,196,9,163,221,190,62,102,280,71,87,102,268

%N Remainder when n^n is divided by the n-th prime number.

%H T. D. Noe, <a href="/A117131/b117131.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = mod(n^n, prime(n)).

%e a(8)=7 because 8^8 is 16777216, the 8th prime is 19 and 16777216 modulo 19 is 7.

%p a:= n-> n&^n mod ithprime(n):

%p seq(a(n), n=1..81); # _Alois P. Heinz_, Mar 20 2019

%t Table[PowerMod[n, n, Prime[n]], {n, 100}] (* _T. D. Noe_, Aug 20 2013 *)

%o (Magma) [Modexp(n, n, NthPrime(n)): n in [1..100]]; // _Vincenzo Librandi_, Mar 20 2019

%o (PARI) a(n) = lift(Mod(n, prime(n))^n); \\ _Michel Marcus_, Mar 20 2019

%Y Cf. A000312, A069547.

%K nonn,look,easy

%O 1,3

%A _Axel Harvey_, Jul 23 2006

%E More terms from _Franklin T. Adams-Watters_, Jul 26 2006

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 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)