login
a(n) = (n*prime(n)) mod prime(n+1).
3

%I #38 Jan 21 2021 11:57:00

%S 2,1,1,6,3,10,5,14,4,11,8,34,17,38,16,22,27,26,66,33,32,78,40,2,1,51,

%T 106,53,110,88,7,82,73,107,81,98,104,15,112,118,99,153,107,21,109,81,

%U 105,35,131,33,172,137,223,190,196,202,157,206,45,163,269,53

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

%H Seiichi Manyama, <a href="/A340128/b340128.txt">Table of n, a(n) for n = 1..10000</a>

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

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

%e a(3) = (prime(3) * 3) mod prime(3+1) = 5 * 3 mod 7 = 1,

%e a(4) = (prime(4) * 4) mod prime(4+1) = 7 * 4 mod 11 = 6,

%e a(5) = (prime(5) * 5) mod prime(5+1) = 11 * 5 mod 13 = 3.

%t Table[Mod[n*Prime[n],Prime[n+1]],{n,62}] (* _Stefano Spezia_, Jan 17 2021 *)

%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) = (prime(n)*n) % prime(n+1); \\ _Michel Marcus_, Jan 20 2021

%Y Cf. A000040, A033286, A340649.

%K nonn,look

%O 1,1

%A _Simon Strandgaard_, Jan 15 2021