OFFSET
1,3
COMMENTS
Exponent of Mersenne number formula does not have to be a prime.
FORMULA
a(n) = mod (mersenne(n) / prime(n))
where mersenne(n) returns n-th mersenne number and, correspondingly, prime(n) returns n-th prime number.
EXAMPLE
a(1) = mod(mersenne(1)/prime(1)) = mod(1/2) = 1
a(2) = mod(mersenne(2)/prime(2)) = mod(3/3) = 0
a(3) = mod(mersenne(3)/prime(3)) = mod(7/5) = 2
a(4) = mod(mersenne(4)/prime(4)) = mod(15/7) = 1
a(5) = mod(mersenne(5)/prime(5)) = mod(31/11) = 9
PROG
(MATLAB)
% n = number of computed terms of sequence
for i=1:n,
a(i) = mod(mersenne(i), prime(i)) ;
end
(PARI) a(n) = (2^n-1)%prime(n)
(PARI) a(n)=lift(Mod(2, prime(n))^n-1) \\ Charles R Greathouse IV, Jun 29 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Pasi Airikka, Jun 28 2011
STATUS
approved