login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = (prime(n)^n) mod prime(n+1).
0

%I #10 Jan 21 2021 10:51:25

%S 2,4,6,3,7,16,5,9,7,1,6,16,21,32,36,16,17,22,63,4,10,75,63,96,1,38,2,

%T 66,109,100,82,119,57,53,119,67,141,137,116,89,103,85,187,101,74,58,

%U 146,144,216,37,238,16,4,21,254,185,216,187,43,15,123,109,69

%N a(n) = (prime(n)^n) mod prime(n+1).

%e a(1) = prime(1)^1 mod prime(1+1) = 2^1 mod 3 = 2 mod 3 = 2,

%e a(2) = prime(2)^2 mod prime(2+1) = 3^2 mod 5 = 9 mod 5 = 4,

%e a(3) = prime(3)^3 mod prime(3+1) = 5^3 mod 7 = 125 mod 7 = 6,

%e a(4) = prime(4)^4 mod prime(4+1) = 7^4 mod 11 = 2401 mod 11 = 3,

%e a(5) = prime(5)^5 mod prime(5+1) = 11^5 mod 13 = 161051 mod 13 = 7.

%o (Ruby) require 'prime'

%o values = []

%o primes = Prime.first(20)

%o primes.each_index do |n|

%o next if n < 1

%o values << (primes[n-1] ** n) % primes[n]

%o end

%o p values

%o (PARI) a(n)=my(p=prime(n)); lift(Mod(p, nextprime(p+1))^n); \\ _Michel Marcus_, Jan 14 2021

%Y Cf. A000040, A240546.

%K nonn

%O 1,1

%A _Simon Strandgaard_, Jan 14 2021