cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-18 of 18 results.

A131460 Residues of 3^(2^(p(n)-1)+1) for Mersenne numbers with prime indices.

Original entry on oeis.org

0, 5, 22, 118, 1803, 8182, 131062, 524278, 498820, 271127480, 2147483638, 44060320367, 967030303245, 7907414671310, 49672464783624, 5545884378065500, 125222315103997360, 2305843009213693942, 130613131595363896897
Offset: 1

Views

Author

Dennis Martin (dennis.martin(AT)dptechnology.com), Jul 13 2007, Jul 20 2007

Keywords

Comments

Mp is prime iff 3^(2^(p(n)-1)+1) is congruent to (-9) Mod Mp. Thus M7 = 127 is prime because 3^65 Mod 127 = 118 (=127-9) while M11 = 2047 is composite because 3^1025 Mod 2047 <> 2038.

Examples

			a(5) = 3^(2^(11-1)+1) Mod 2^11-1 = 3^1025 Mod 2047 = 1803
		

Crossrefs

Formula

a(n) = 3^(2^(p(n)-1)+1) Mod 2^p(n)-1

A131461 Residues of 3^(2^p(n)-2) for Mersenne numbers with prime indices.

Original entry on oeis.org

0, 1, 1, 1, 1013, 1, 1, 1, 5884965, 65165529, 1, 103888408793, 474639880182, 4112907695371, 72685811469476, 5155089749987738, 440411515280180314, 1, 95591506202441271281, 69291880649932219827
Offset: 1

Views

Author

Dennis Martin (dennis.martin(AT)dptechnology.com), Jul 20 2007

Keywords

Comments

M_p is prime iff 3^(M_p-1) is congruent to 1 mod M_p. Thus M_7 = 127 is prime because 3^126 mod 127 = 1 while M_11 = 2047 is composite because 3^2046 mod 2047 <> 1.

Examples

			a(5) = 3^(2^11-2) mod 2^11-1 = 3^2046 mod 2047 = 1013
		

Crossrefs

Formula

a(n) = 3^(2^p(n)-2) mod 2^p(n)-1

A131462 Residues of 3^(2^p(n)-1) for Mersenne numbers with prime indices.

Original entry on oeis.org

0, 3, 3, 3, 992, 3, 3, 3, 877681, 195496587, 3, 36787319437, 1423919640546, 3542630063906, 77319946053101, 6458069995222223, 168313041233693968, 3, 139200566017647400916, 207875641949796659481
Offset: 1

Views

Author

Dennis Martin (dennis.martin(AT)dptechnology.com), Jul 20 2007

Keywords

Comments

M_p is prime iff 3 ^ M_p is congruent to 3 mod M_p. Thus M_7 = 127 is prime because 3^127 mod 127 = 3 while M_11 = 2047 is composite because 3^2047 mod 2047 <> 3.

Examples

			a(5) = 3^(2^11-1) mod 2^11-1 = 3^2047 mod 2047 = 992
		

Crossrefs

Formula

a(n) = 3^(2^p(n)-1) mod 2^p(n)-1

A131463 Residues of 3^(2^p(n)) for Mersenne numbers with prime indices.

Original entry on oeis.org

0, 2, 9, 9, 929, 9, 9, 9, 2633043, 49618850, 9, 110361958311, 2072735666087, 1831797169511, 91222349803976, 1359811476184687, 504939123701081904, 9, 122453792873589376894, 623626925849389978443
Offset: 1

Views

Author

Dennis Martin (dennis.martin(AT)dptechnology.com), Jul 20 2007

Keywords

Comments

M_p is prime iff 3^(M_p+1) is congruent to 9 mod M_p. Thus M_7 = 127 is prime because 3^128 mod 127 = 9 while M_11 = 2047 is composite because 3^2048 mod 2047 <> 9.

Examples

			a(5) = 3^(2^11) mod 2^11-1 = 3^2048 mod 2047 = 929
		

Crossrefs

Formula

a(n) = 3^(2^p(n)) mod 2^p(n)-1

A135927 a(n) = a(n-1)^2 - 2 with a(1) = 10.

Original entry on oeis.org

10, 98, 9602, 92198402, 8500545331353602, 72259270930397519221389558374402, 5221402235392591963136699520829303150191924374488750728808857602
Offset: 1

Views

Author

Ant King, Dec 07 2007

Keywords

Comments

This is the Lucas-Lehmer sequence with starting value u(1) = 10 and the position of the zeros when it is reduced mod(2^p - 1) also gives the position of the Mersenne primes. As we have started with n = 1, these will occupy the (p - 1)th positions in the sequence. For example, the first 12 terms mod(2^13 - 1) are 10, 98, 1411, 506, 2113, 672, 1077, 4996, 2037, 4721, 128, 0 and hence 8191 is a Mersenne prime. The radicals in the above closed forms are the solutions to x^2 - 10x + 1 = 0.

Examples

			a(4) = 2*cosh(2^3*log(5 + 2*sqrt(6))) = 92198402.
		

Crossrefs

Programs

Formula

a(n) = 2*cosh(2^(n-1)*log(5 + 2*sqrt(6))) = exp(2^(n-1)*log(5 + 2*sqrt(6))) + exp(2^(n-1)*log(5 - 2*sqrt(6))) = (5 + 2*sqrt(6))^(2^(n-1)) + (5 - 2*sqrt(6))^(2^(n-1)) = ceiling(exp(2^(n-1)*log(5 + 2*sqrt(6)))) = ceiling((5 + 2*sqrt(6))^(2^(n-1))).
From Peter Bala, Feb 01 2022: (Start)
Product_{n >= 1} (1 + 2/a(n)) = (1/2)*sqrt(6); Product_{n >= 1} (1 - 1/a(n)) = (4/11)*sqrt(6).
Engel expansion of 5 - sqrt(24) = 1/a(1) + 1/(a(1)*a(2)) + 1/(a(1)*a(2)*a(3)) + .... See Klambauer, p. 130. (End)

A317977 a(n) = A003010(n-2) mod (2^n - 1).

Original entry on oeis.org

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
Offset: 2

Views

Author

Thomas Ordowski, Aug 12 2018

Keywords

Comments

For n > 2, the Mersenne number 2^n - 1 is a prime if and only if a(n) = 0. See comments in A003010.

Crossrefs

Programs

  • 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

Formula

a(prime(n)) = A095847(n).

Extensions

More terms from Michel Marcus and David A. Corneth, Aug 12 2018

A331038 Residues of the Lucas-Lehmer primality test for M(127) = 2^127 - 1.

Original entry on oeis.org

3, 7, 47, 2207, 4870847, 23725150497407, 562882766124611619513723647, 9932388036497706472820043948129789713, 102423269049837077051675109560558766898, 7949236499829405891753012242872011683, 119093374737774941856311333667076322210
Offset: 0

Views

Author

Sergio Pimentel, Jan 08 2020

Keywords

Comments

Since a(125) = 0, 2^127 - 1 = 170141183460469231731687303715884105727 is prime. This calculation was carried out by hand by Edouard Lucas. It took him 19 years from 1857 to 1876. The method works with a(0) = 3 since M(127) == 3 (mod 4). It also works with a(0) = 4 or a(0) = 10.

Crossrefs

Programs

  • Mathematica
    NestList[Mod[#^2-2,2^127-1]&, 3,10] (* Stefano Spezia, Mar 28 2025 *)

Formula

a(n) = (a(n-1)^2 - 2) mod (2^127-1) with a(0) = 3; a(125) is the final term.

A248755 a(n) is the number of iterations for the Lucas-Lehmer sequence A003010 (mod p_n) to enter a loop, where p_n is the n-th prime number A000040(n).

Original entry on oeis.org

2, 2, 1, 4, 3, 3, 4, 2, 5, 4, 6, 5, 4, 5, 11, 3, 15, 6, 5, 3, 5, 6, 11, 13, 5, 4, 9, 27, 11, 10, 8, 7, 23, 13, 20, 12, 14, 10, 41, 28, 12, 4, 36, 4, 15, 13, 27, 8, 15, 11, 13, 24, 5, 51, 8, 65, 36, 8, 13, 47, 36, 42, 31, 20, 13, 52, 42, 6, 87, 16, 30, 89, 15, 7, 36, 95, 6, 17, 34, 10
Offset: 1

Views

Author

Robert G. Wilson v, Oct 13 2014

Keywords

Comments

The Lucas-Lehmer sequence is used to test for Mersenne primes (A001348), but this is irrelevant for this sequence.

Examples

			a(4) is 4 because p_4 = 7, and the sequence A003010 (mod 7) becomes -> 4, 0, 5, 2, 2, 2, 2, 2, 2, .... The term 2 which is the first term of an infinite loop is at position 4.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := -1 + Length@ NestWhileList[ Mod[#^2 - 2, Prime[n]] &, 4, UnsameQ[##] &, {2, Infinity}]; Array[f, 80]
Previous Showing 11-18 of 18 results.