login
A138676
a(n) = prime(n)^7 mod prime(n-1).
10
1, 2, 3, 4, 7, 4, 9, 6, 3, 12, 6, 30, 5, 1, 4, 43, 10, 7, 36, 57, 54, 31, 60, 45, 88, 27, 7, 21, 34, 98, 1, 120, 128, 62, 128, 133, 5, 84, 44, 22, 128, 112, 128, 172, 128, 67, 210, 105, 128
OFFSET
2,2
COMMENTS
a(n) = 128 if prime(n-1) and prime(n) are twin primes and prime(n-1)>128. - Robert Israel, Feb 12 2020
LINKS
EXAMPLE
a(1)=1 because 3^7 = 1 mod 2
a(2)=2 because 5^7 = 2 mod 3
MAPLE
seq(ithprime(n)&^7 mod ithprime(n-1), n=2..100); # Robert Israel, Feb 12 2020
MATHEMATICA
Table[Mod[Prime[n]^7, Prime[n - 1]], {n, 2, 50}]
(* The following program is more efficient because it only generates each prime once, but it is less easy to understand: *)
PowerMod[Last[#], 7, First[#]]&/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Sep 02 2016 *)
PROG
(Magma) [NthPrime(n)^7 mod NthPrime(n-1): n in [2..50]]; // Bruno Berselli, May 23 2011
(PARI) a(n) = my(p=prime(n)); lift(Mod(p, precprime(p-1))); \\ Michel Marcus, Mar 17 2023
KEYWORD
nonn,look
AUTHOR
Artur Jasinski, Mar 26 2008
STATUS
approved