OFFSET
1,4
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
Simon Strandgaard, Animations of ((n+k)*prime(n+1)) mod prime(n) when k varies, YouTube video, 2021.
FORMULA
a(n) = A117495(n+1) mod prime(n). - Michel Marcus, Jan 15 2021
EXAMPLE
a(1) = (prime(1+1) * 1) mod prime(1) = 3 * 1 mod 2 = 1,
a(2) = (prime(2+1) * 2) mod prime(2) = 5 * 2 mod 3 = 1,
a(3) = (prime(3+1) * 3) mod prime(3) = 7 * 3 mod 5 = 1,
a(4) = (prime(4+1) * 4) mod prime(4) = 11 * 4 mod 7 = 2,
a(5) = (prime(5+1) * 5) mod prime(5) = 13 * 5 mod 11 = 10.
MATHEMATICA
Table[Mod[Prime[n + 1]*n, Prime[n]], {n, 1, 64}] (* Robert P. P. McKone, Jan 15 2021 *)
PROG
(Ruby) require 'prime'
values = []
primes = Prime.first(20)
primes.each_index do |n|
next if n < 1
values << (primes[n] * n) % primes[n-1]
end
p values
(PARI) a(n) = prime(n+1)*n % prime(n); \\ Michel Marcus, Jan 15 2021
(Magma) [ (n*NthPrime(n+1)) mod NthPrime(n) : n in [1..60]]; // Wesley Ivan Hurt, Apr 23 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Simon Strandgaard, Jan 14 2021
STATUS
approved