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 21-30 of 38 results. Next

A129222 Residues of the Lucas - Lehmer primality test for M(17) = 131071.

Original entry on oeis.org

4, 14, 194, 37634, 95799, 119121, 66179, 53645, 122218, 126220, 70490, 69559, 99585, 78221, 130559, 0
Offset: 0

Views

Author

Sergio Pimentel, Apr 04 2007

Keywords

Comments

Since a(15) = 0, M(17) = 131071 is prime.

Examples

			a(15) = 130559^2 - 2 mod 131071 = 0.
		

Crossrefs

Formula

a(0) = 4, a(n) = a(n-1)^2 mod 2^p-1. Last term: a(p-2).

A129223 Residues of the Lucas - Lehmer primality test for M(19) = 524287.

Original entry on oeis.org

4, 14, 194, 37634, 218767, 510066, 386344, 323156, 218526, 504140, 103469, 417706, 307417, 382989, 275842, 85226, 523263, 0
Offset: 0

Views

Author

Sergio Pimentel, Apr 04 2007

Keywords

Comments

Since a(17) = 0, M(19) = 524287 is prime.

Examples

			a(17) = 523263^2 - 2 mod 524287 = 0.
		

Crossrefs

Formula

a(0) = 4, a(n) = a(n-1)^2 mod 2^p-1. Last term: a(p-2).

A129224 Residues of the Lucas - Lehmer primality test for M(23) = 8388607.

Original entry on oeis.org

4, 14, 194, 37634, 7031978, 7033660, 1176429, 7643358, 3179743, 2694768, 763525, 4182158, 7004001, 1531454, 5888805, 1140622, 4321431, 7041324, 2756392, 1280050, 6563009, 6107895
Offset: 0

Views

Author

Sergio Pimentel, Apr 04 2007

Keywords

Comments

Since a(21) > 0, M(23) = 8388607 is composite. Mersenne numbers are only prime if a(p-2) = 0.

Examples

			a(21) = 6563009^2 - 2 mod 8388607 = 6107895.
		

Crossrefs

Formula

a(0) = 4, a(n) = a(n-1)^2 mod 2^p-1. Last term: a(p-2).

A129226 Residues of the Lucas - Lehmer primality test for M(31) = 2147483647.

Original entry on oeis.org

4, 14, 194, 37634, 1416317954, 669670838, 1937259419, 425413602, 842014276, 12692426, 2044502122, 1119438707, 1190075270, 1450757861, 877666528, 630853853, 940321271, 512995887, 692931217, 1883625615, 1992425718
Offset: 0

Views

Author

Sergio Pimentel, Apr 04 2007

Keywords

Comments

Since a(29) = 0, M(31) = 2147483647 is prime. Mersenne numbers are only prime if a(p-2) = 0.

Examples

			a(29) = 65536^2 - 2 mod 2147483647 = 0.
		

Crossrefs

Programs

  • Python
    p = 31; Mp = 2**p - 1
    from itertools import accumulate
    def f(anm1, _): return (anm1**2 - 2) % Mp
    print(list(accumulate([4]*30, f))) # Michael S. Branicky, Apr 14 2021

Formula

a(0) = 4, a(n) = a(n-1)^2 mod 2^p-1. Last term: a(p-2).

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)

A145503 a(n+1) = a(n)^2+2*a(n)-2 and a(1)=3.

Original entry on oeis.org

3, 13, 193, 37633, 1416317953, 2005956546822746113, 4023861667741036022825635656102100993
Offset: 1

Views

Author

Artur Jasinski, Oct 11 2008

Keywords

Comments

General formula for a(n+1)=a(n)^2+2*a(n)-2 and a(1)=k+1 is a(n)=Floor[((k + Sqrt[k^2 + 4])/2)^(2^((n+1) - 1)).
Essentially the same as A110407. [R. J. Mathar, Mar 18 2009]

Crossrefs

Programs

  • Mathematica
    aa = {}; k = 3; Do[AppendTo[aa, k]; k = k^2 + 2 k - 2, {n, 1, 10}]; aa
    (* or *)
    k = 2; Table[Floor[((k + Sqrt[k^2 + 4])/2)^(2^(n - 1))], {n, 2, 7}]
    NestList[#^2+2#-2&,3,10] (* Harvey P. Dale, Feb 01 2018 *)

Formula

From Peter Bala, Nov 12 2012: (Start)
a(n) = alpha^(2^(n-1)) + (1/alpha)^(2^(n-1)) - 1, where alpha := 2 + sqrt(3).
a(n) = A003010(n-1) - 1. a(n) = 2*A002812(n-1) - 1.
Recurrence: a(n) = 5*(Product {k = 1..n-1} a(k)) - 2 with a(1) = 3.
Product_{n >= 1} (1 + 1/a(n)) = 5/6*sqrt(3).
Product_{n >= 1} (1 + 2/(a(n) + 1)) = sqrt(3).
(End)

A219163 Recurrence equation a(n+1) = a(n)^4 - 4*a(n)^2 + 2 with a(0) = 4.

Original entry on oeis.org

4, 194, 1416317954, 4023861667741036022825635656102100994
Offset: 0

Views

Author

Peter Bala, Nov 13 2012

Keywords

Comments

Bisection of A003010.
a(4) has 147 digits and a(5) has 586 digits. - Harvey P. Dale, Mar 03 2020

Crossrefs

Programs

  • Mathematica
    NestList[#^4-4#^2+2&,4,5] (* Harvey P. Dale, Mar 03 2020 *)
  • PARI
    a(n)={if(n==0,4,a(n-1)^4-4*a(n-1)^2+2)} \\ Edward Jiang, Sep 11 2014

Formula

Let alpha = 2 + sqrt(3). Then a(n) = (alpha)^(4^n) + (1/alpha)^(4^n).
a(n) = A003010(2*n) = A003500(4^n).
Product_{n >= 0} ((1 + 2/a(n))/(1 - 2/a(n)^2)) = sqrt(3).
From Peter Bala, Dec 06 2022: (Start)
a(n) = 2*T(4^n,2), where T(n,x) denotes the n-th Chebyshev polynomial of the first kind.
Let b(n) = a(n) - 4. The sequence {b(n)} appears to be a strong divisibility sequence, that is, gcd(b(n),b(m)) = b(gcd(n,m)) for n, m >= 1. (End)

A110407 Integers with mutual residues -2.

Original entry on oeis.org

3, 5, 13, 193, 37633, 1416317953, 2005956546822746113, 4023861667741036022825635656102100993, 16191462721115671781777559070120513664958590125499158514329308740975788033
Offset: 1

Views

Author

Seppo Mustonen, Sep 11 2005

Keywords

Comments

This is the special case k=2 of sequences with mutual residues -k. In general, a(1)=k+1 and a(n)=min{m | m>a(n-1), mod(m,a(i))=-k, i=1,...,n-1}.
An infinite coprime sequence

Programs

  • Maple
    a:=proc(k,n::nonnegint) option remember; if n<3 then RETURN(n*k+1); fi; if n=3 then RETURN(a(k,1)*a(k,2)-k); fi; a(k,n-1)*(a(k,n-1)+k)-k; end; seq(a(2,n),n=1..9);
  • Mathematica
    Join[{3,5},NestList[#^2+2#-2&,13,6]] (* Harvey P. Dale, Mar 05 2019 *)

Formula

a(1)=3, a(2)=5, a(n)=-2+a(1)*a(2)*...*a(n-1) [typo corrected by Vincenzo Librandi, Feb 08 2010]
a(n)=a(n-1)^2+2*a(n-1)-2, for n>3.
Apparently a(n)=A003010(n-2)-1 for n>=3. - R. J. Mathar, Apr 22 2007

A123271 Sign of the penultimate term of the Lucas-Lehmer sequence modulo the n-th Mersenne prime.

Original entry on oeis.org

1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1
Offset: 2

Views

Author

Max Alekseyev, Oct 10 2006, Sep 29 2007

Keywords

Comments

Also known as the Lehmer symbol ϵ(4, p) for Mersenne prime exponent p.
For the n-th Mersenne prime 2^p - 1 = A000668(n) (with p=A000043(n)), we have A003010(p-2) == 0 (mod 2^p - 1). Therefore A003010(p-3) == a(n) * 2^((p+1)/2) (mod 2^p - 1) where a(n) = 1 or -1.
From currently known Mersenne primes we have these exponents and sequence values: (74207281: -1, 77232917: 1, 82589933: -1, 136279841: 1), but there is a possibility of new Mersenne primes to be found out of order. - Serge Batalov, Feb 04 2013; updated by Max Alekseyev, Feb 25 2018, updated by Gord Palameta, Oct 21 2024

Examples

			From _Serge Batalov_, Feb 04 2013: (Start)
For n=3, p=5, M_p=31, and the Lucas-Lehmer sequence is (4, 14, 8, 0). The penultimate element is 1*2^3 == 8 (mod 31), so a(3)=1.
For n=4, p=7, M_p=127, and the Lucas-Lehmer sequence is (4, 14, 67, 42, 111, 0). The penultimate element is -1*2^4 == 111 (mod 127), so a(4)=-1.
(End)
		

Crossrefs

Programs

  • PARI
    test(p)=s=Mod(4, 2^p-1); for(i=1, p-3, s=s^2-2); r=2^((p+1)/2); if(s==+r,+1,s==-r,-1,"error") \\ Then a(n) = test(A000043(n)). From Jeppe Stig Nielsen, Jan 25 2016

Formula

a(n) = 1 or -1 such that A003010(A000043(n)-3) == a(n) * 2^((A000043(n)+1)/2) (mod A000668(n)).

Extensions

More terms from Andreas Höglund, Sep 29 2007
a(40) added by Max Alekseyev, Feb 07 2011
a(41)-a(46) and prospective a(47)-a(48) from Andreas Höglund via Serge Batalov, Feb 04 2013; Max Alekseyev, Feb 25 2018
a(47) added by Gord Palameta, Dec 21 2018
a(48) added by Gord Palameta, Oct 21 2024

A128976 Number of cycles for the map LL:x->x^2-2 acting on Z/(2^n-1).

Original entry on oeis.org

2, 1, 1, 2, 2, 4, 6, 8, 6, 8, 14, 25, 36, 180, 76, 80, 66, 2068, 354, 7316, 740, 1776, 2198, 264, 792, 3278, 122396, 848, 17312, 27743, 36696, 17896832
Offset: 0

Views

Author

M. F. Hasler, Apr 29 2007, corrected May 19 2007

Keywords

Comments

A cycle is the orbit of an element x of Z/(2^n-1), i.e., { x, LL(x), ..., LL^c(x)=x } for some positive integer c.

Examples

			a(0)=2 since fixed points 2 and -1 are the only cycles for LL on Z/(0) = Z;
a(1)=1 since Z/(1) = {0};
a(2)=1 since 2=-1 is a cycle of length 1 (fixed point) for LL on Z/(3) and LL(0)=-2=1, LL(1)=-1;
a(3)=2 since 3,4(=-3) -> 0 -> 5(=-2) -> {2} and 1 -> {6(=-1)} for LL acting on Z/(7);
a(5)=4 since {2}, {30}, {12,18} and {3,7,16,6} are the cycles for LL acting on Z/(31).
		

Crossrefs

Cf. A003010.

Programs

  • PARI
    numcycles(q) = { my(Mq=2^q-1, v=vector(Mq+1), c=1, i, start, cyc=0); if(q<2,return(1+!q)); for( j=1, #v, if(v[j],next); i=j; start=c; until(v[i=1+((i-1)^2-2)%Mq],v[i]=c++); if(v[i]>start, cyc++)); cyc; }
    A128976=vector(20,i,numcycles(i-1))

Formula

If p=2^n-1 is prime, then a(n) = 1/2 + Sum_{d|2^(n-1)-1} eulerphi(d)/ordp(2,d)/2, where ordp(2,d) = min { e in N* | 2^e == 1 (mod d) or 2^e == -1 (mod d) }

Extensions

a(20)-a(31) from Max Alekseyev, Aug 25 2023
Previous Showing 21-30 of 38 results. Next