login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317977 a(n) = A003010(n-2) mod (2^n - 1). 1
1, 0, 14, 0, 23, 0, 149, 205, 95, 1736, 779, 0, 4193, 20400, 25439, 0, 221468, 0, 1036394, 840107, 1751891, 6107895, 5639594, 8772568, 66322529, 60611448, 99083624, 458738443, 989927528, 0, 3038229779, 5238898821, 393215, 11960838285, 27264928469, 117093979072, 274827575393, 276971366821 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,3
COMMENTS
For n > 2, the Mersenne number 2^n - 1 is a prime if and only if a(n) = 0. See comments in A003010.
LINKS
FORMULA
a(prime(n)) = A095847(n).
PROG
(PARI) a(n) = {my(pow = 2^n-1, res = Mod(4, pow)); for(i = 1, n-2, res = res^2 - 2); lift(res)}
first(n) = vector(n, i, a(i+1)) \\ David A. Corneth, Aug 12 2018
(Python)
def A317977(n):
m = 2**n-1
c = 4 % m
for _ in range(n-2):
c = (c**2-2) % m
return c # Chai Wah Wu, Oct 08 2018
CROSSREFS
Sequence in context: A002337 A008423 A240252 * A023918 A062785 A161384
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Aug 12 2018
EXTENSIONS
More terms from Michel Marcus and David A. Corneth, Aug 12 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 7 06:01 EDT 2024. Contains 374063 sequences. (Running on oeis4.)