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.

Showing 1-10 of 21 results. Next

A109828 Duplicate of A005603.

Original entry on oeis.org

11, 7, 2, 2131, 1531, 385591, 16651, 15514861, 857095381, 205528443121, 1389122693971, 216857744866621, 758083947856951, 107588900851484911, 69257563144280941, 3203000719597029781
Offset: 1

Views

Author

Keywords

A005382 Primes p such that 2p-1 is also prime.

Original entry on oeis.org

2, 3, 7, 19, 31, 37, 79, 97, 139, 157, 199, 211, 229, 271, 307, 331, 337, 367, 379, 439, 499, 547, 577, 601, 607, 619, 661, 691, 727, 811, 829, 877, 937, 967, 997, 1009, 1069, 1171, 1237, 1279, 1297, 1399, 1429, 1459, 1531, 1609, 1627, 1657, 1759, 1867, 2011
Offset: 1

Views

Author

Keywords

Comments

Sequence gives values of p such Sum_{i=1..p} gcd(p,i) = A018804(p) is prime. - Benoit Cloitre, Jan 25 2002
Let q = 2n-1. For these n (and q), the sum of two cyclotomic polynomials can be written as a product of cyclotomic polynomials and as a cyclotomic polynomial in x^2: Phi(q,x) + Phi(2q,x) = 2 Phi(n,x) Phi(2n,x) = 2 Phi(n,x^2). - T. D. Noe, Nov 04 2003
Primes in A006254. - Zak Seidov, Mar 26 2013
If a(n) is in A168421 then A005383(n) is a twin prime with a Ramanujan prime, A005383(n) - 2. If this sequence has an infinite number of terms in A168421, then the twin prime conjecture can be proved. - John W. Nicholson, Dec 05 2013
Records subsequence of A023509 (n >= 2). - David James Sycamore, May 05 2025

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A010051, A000040, A053685 (subsequence), A006254.
Cf. A023509.

Programs

  • Haskell
    a005382 n = a005382_list !! (n-1)
    a005382_list = filter
       ((== 1) . a010051 . (subtract 1) . (* 2)) a000040_list
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Magma
    [n: n in [0..1000] | IsPrime(n) and IsPrime(2*n-1)]; // Vincenzo Librandi, Nov 18 2010
    
  • Maple
    f := proc(Q) local t1,i,j; t1 := []; for i from 1 to 500 do j := ithprime(i); if isprime(2*j-Q) then t1 := [op(t1),j]; fi; od: t1; end; f(1);
    # second Maple program:
    q:= p-> andmap(isprime, [p, 2*p-1]):
    select(q, [$2..2500])[];  # Alois P. Heinz, Dec 16 2024
  • Mathematica
    Select[Prime[Range[300]], PrimeQ[2#-1]&]
  • PARI
    select(p->isprime(2*p-1),primes(500)) \\ Charles R Greathouse IV, Apr 26 2012
    
  • PARI
    forprime(n=2, 10^3, if(ispseudoprime(2*n-1), print1(n, ", "))) \\ Felix Fröhlich, Jun 15 2014

Formula

a(n) = A129521(n) / A005383(n). - Reinhard Zumkeller, Apr 19 2007
a(n) = (A005383(n) + 1)/2. - Zak Seidov, Nov 04 2010

A005383 Primes p such that (p+1)/2 is prime.

Original entry on oeis.org

3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253
Offset: 1

Views

Author

Keywords

Comments

Also, n such that sigma(n)/2 is prime. - Joseph L. Pe, Dec 10 2001; confirmed by Vladeta Jovovic, Dec 12 2002
Primes that are followed by twice a prime, i.e., are followed by a semiprime. (For primes followed by two semiprimes, see A036570.) - Zak Seidov, Aug 03 2013, Dec 31 2015
If A005382(n) is in A168421 then a(n) is a twin prime with a Ramanujan prime, A104272(k) = a(n) - 2. - John W. Nicholson, Jan 07 2016
Starting with 13 all terms are congruent to 1 mod 12. - Zak Seidov, Feb 16 2017
Numbers n such that both n and n+12 are terms are 61, 661, 1201, 4261, 5101, 6121, 6361 (all congruent to 1 mod 60). - Zak Seidov, Mar 16 2017
Primes p for which there exists a prime q < p such that 2q == 1 (mod p). Proof: q = (p + 1)/2. - David James Sycamore, Nov 10 2018
Prime numbers n such that phi(sigma(2n)) = phi(2n), excluding n=3 and n=5; as well as phi(sigma(3n)) = phi(3n), excluding n=3 only. - Richard R. Forberg, Dec 22 2020

Examples

			Both 3 and (3+1)/2 = 2 are primes, both 5 and (5+1)/2 = 3 are primes. - _Zak Seidov_, Nov 19 2012
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A subsequence of A000040 which has A036570 as subsequence.

Programs

  • Haskell
    a005383 n = a005383_list !! (n-1)
    a005383_list = [p | p <- a065091_list, a010051 ((p + 1) `div` 2) == 1]
    -- Reinhard Zumkeller, Nov 06 2012
    
  • MATLAB
    LIMIT = 8000 % Find all members of A005383 less than LIMIT A = primes(LIMIT); n = length(A); %n is number of primes less than LIMIT B = 2*A - 1; C = ones(n, 1)*A; %C is an n X n matrix, with C(i, j) = j-th prime D = B'*ones(1, n); %D is an n X n matrix, with D(i, j) = (i-th prime)*2 - 1 [i, j] = find(C == D); A(j)
    
  • Magma
    [n: n in [1..3300] | IsPrime(n) and IsPrime((n+1) div 2) ]; // Vincenzo Librandi, Sep 25 2012
    
  • Maple
    for n to 300 do
      X := ithprime(n);
    Y := ithprime(n+1);
    Z := 1/2 mod Y;
      if isprime(Z) then print(Y);
    end if:
    end do:
    # David James Sycamore, Nov 11 2018
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[(# + 1)/2] &] (* Zak Seidov, Nov 19 2012 *)
  • PARI
    A005383_list(n) = select(m->isprime(m\2+1),primes(n)[2..n]) \\ Charles R Greathouse IV, Sep 25 2012
    
  • Python
    from sympy import isprime
    [n for n in range(3, 5000) if isprime(n) and isprime((n + 1)//2)]
    # Indranil Ghosh, Mar 17 2017
    
  • Sage
    [n for n in prime_range(3, 1000) if is_prime((n + 1) // 2)]
    # F. Chapoton, Dec 17 2019

Formula

a(n) = A129521(n)/A005382(n). - Reinhard Zumkeller, Apr 19 2007
A000035(a(n))*A010051(a(n))*A010051((a(n)+1)/2) = 1. - Reinhard Zumkeller, Nov 06 2012
a(n) = 2*A005382(n) - 1. - Zak Seidov, Nov 19 2012
a(n) = A005382(n) + phi(A005382(n)) = A005382(n) + A000010(A005382(n)). - Torlach Rush, Mar 10 2014

Extensions

More terms from David Wasserman, Jan 18 2002
Name changed by Jianing Song, Nov 27 2021

A005602 Smallest prime beginning a complete Cunningham chain of length n (of the first kind).

Original entry on oeis.org

13, 3, 41, 509, 2, 89, 1122659, 19099919, 85864769, 26089808579, 665043081119, 554688278429, 4090932431513069, 95405042230542329, 90616211958465842219, 810433818265726529159
Offset: 1

Views

Author

Keywords

Comments

The word "complete" indicates each chain is exactly n primes long (i.e., the chain cannot be a subchain of another one). Except for a(1), each term, by definition, is a Sophie Germain prime (A005384) as is each element except the last in each chain; each element after the first in each chain is a safe prime (A005385), so interior elements are both.

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Extensions

a(13) found by Jack Brennen; a(14) found by Paul Jobling (Paul.Jobling(AT)WhiteCross.com) [Oct 23 2000]
Better description from Rick L. Shepherd, Jul 07 2004
a(15) found by Jonathan Webster and Jonathan Sorenson, added Jun 26 2018
a(16) found by Phil Carmody and Paul Jobling, Feb 2002, and added by Mauro Fiorentini, Feb 21 2025

A057326 First member of a prime triple in a 2p-1 progression.

Original entry on oeis.org

2, 19, 79, 331, 439, 499, 619, 829, 1069, 1279, 1531, 2089, 2131, 2179, 2311, 2791, 3019, 3061, 3109, 3181, 3769, 4159, 4231, 4261, 4621, 4639, 4861, 4951, 5419, 5749, 6121, 6211, 6709, 6841, 7369, 7411, 7561, 7639, 8209, 8629, 9109, 9199, 9319, 9739, 10321, 10831
Offset: 1

Views

Author

Patrick De Geest, Aug 15 2000

Keywords

Comments

Numbers n such that n remains prime through 2 iterations of function f(x) = 2x - 1.

Examples

			Triplets are (2,3,5), (19,37,73), (79,157,313), (331,661,1321), ...
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo (10000) | IsPrime(2*p-1) and IsPrime(4*p-3)]; // K. D. Bajpai, Jun 26 2017
  • Maple
    select(p -> andmap(isprime,[p, 2*p-1, 4*p-3]), [seq(p, p=0..10000)]); # K. D. Bajpai, Jun 26 2017
  • Mathematica
    Select[Prime[Range[1500]],And@@PrimeQ[NestList[2#-1&,#,2]]&] (* Harvey P. Dale, Dec 09 2011 *)
  • PARI
    forprime(p= 1, 100000, if(isprime(2*p-1) && isprime(4*p-3), print1(p, ", "))); \\ K. D. Bajpai, Jun 26 2017
    

Extensions

Offset set to 1 by Michel Marcus, Jul 02 2017

A057330 First member of a prime n-tuplet in a 2p-1 progression.

Original entry on oeis.org

2, 2, 2, 1531, 1531, 16651, 16651, 15514861, 857095381, 205528443121, 1389122693971, 216857744866621, 758083947856951, 69257563144280941, 69257563144280941, 3203000719597029781
Offset: 1

Views

Author

Patrick De Geest, Aug 15 2000

Keywords

Comments

Initial terms of A000040, A005382, A057326, A057327, A057328, A057329.

Crossrefs

See also A005603. Cf. A179866.

Extensions

More terms from Jean Gaumont (jeangaum87(AT)yahoo.com), Apr 16 2006
Offset corrected by Max Alekseyev, May 07 2009
a(16) found by Tony Forbes, added by Jens Kruse Andersen, Jun 14 2014

A057328 First member of a prime 5-tuple in a 2p-1 progression.

Original entry on oeis.org

1531, 6841, 15391, 16651, 33301, 44371, 57991, 66601, 83431, 105871, 145021, 150151, 165901, 199621, 209431, 212851, 231241, 242551, 291271, 319681, 331801, 346141, 377491, 381631, 385591, 445741, 451411, 478801, 481021, 506791, 507781
Offset: 1

Views

Author

Patrick De Geest, Aug 15 2000

Keywords

Comments

Numbers n such that n remains prime through 4 iterations of function f(x) = 2x - 1.

Examples

			Quintuplets are (1531, 3061, 6121, 12241, 24481), (6841, 13681, 27361, 54721, 109441), ...
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(6*10^5) | forall{q: k in [1..4] | IsPrime(q) where q is 2^k*(p-1)+1} ];  // Bruno Berselli, Nov 23 2011
  • Mathematica
    pQ[n_] := And @@ PrimeQ[NestList[2 # - 1 &, n, 4]]; t = {}; Do[p = Prime[n]; If[pQ[p], AppendTo[t, p]], {n, 42500}]; t (* Jayanta Basu, Jun 17 2013 *)
    Select[Prime[Range[50000]],AllTrue[Rest[NestList[2#-1&,#,4]],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 30 2019 *)

A057327 First member of a prime quadruple in a 2p-1 progression.

Original entry on oeis.org

1531, 2131, 2311, 3061, 6211, 6841, 7411, 10321, 13681, 15391, 16651, 18121, 22531, 23011, 24391, 29671, 30781, 31771, 33301, 35311, 41491, 44371, 46411, 54601, 56311, 57991, 60331, 61381, 66601, 67651, 78031, 83431, 85381, 88741
Offset: 1

Views

Author

Patrick De Geest, Aug 15 2000

Keywords

Comments

Numbers n such that n remains prime through 3 iterations of function f(x) = 2x - 1.

Examples

			Quadruplets are (1531,3061,6121,12241), (2131,4261,8521,17041), ...
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[9000]],And@@PrimeQ[NestList[2#-1&,#,3]]&] (* Harvey P. Dale, May 27 2012 *)

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A057329 First member of a prime sextuplet in a 2p-1 progression.

Original entry on oeis.org

16651, 33301, 165901, 331801, 385591, 445741, 478801, 580471, 1203121, 1768441, 1943371, 2041201, 2131141, 2240941, 2340661, 2393431, 2526721, 3277471, 3536881, 3623881, 3880381, 3897631, 4123621, 4415371, 4481881, 5278591
Offset: 1

Views

Author

Patrick De Geest, Aug 15 2000

Keywords

Comments

Numbers n such that n remains prime through 5 iterations of function f(x) = 2x - 1.

Examples

			First sextuplet is (16651,33301,66601,133201,266401,532801).
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(6*10^6) | forall{q: k in [1..5] | IsPrime(q) where q is 2^k*(p-1)+1} ];  // Bruno Berselli, Nov 23 2011

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A063377 Sophie Germain degree of n: number of iterations of n under f(k) = 2k+1 before we reach a number that is not a prime.

Original entry on oeis.org

0, 5, 2, 0, 4, 0, 1, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Reiner Martin, Jul 14 2001

Keywords

Comments

a(n) >= 1 means that n is prime; a(n) >= 2 means that n is a Sophie Germain prime. Is the Sophie Germain degree always finite? Is it unbounded?
A339579 is an essentially identical sequence from 1981. - N. J. A. Sloane, Dec 24 2020
From Michael S. Branicky, Dec 24 2020: (Start)
All n > 5 with a(n) >= 4 satisfy n == 9 (mod 10).
Proof. Let f^k(n) denote iterates of 2*k + 1, with f^0(n) = n.
n != 0, 2, 4, 5, 6, or 8 (mod 10), otherwise f^0(n) is not prime, and a(n) = 0.
n != 7 (mod 10) otherwise f^1(n) = 2*n + 1 == 5 (mod 10), not prime, and a(n) <= 1.
n != 3 (mod 10) otherwise f^2(n) = 4*r + 3 == 5 (mod 10), not prime, and a(n) <= 2.
n != 1 (mod 10) otherwise f^3(n) = 8*r + 7 == 5 (mod 10), not prime, and a(n) <= 3.
(End)
From Peter Schorn, Jan 18 2021: (Start)
The Sophie Germain degree is always finite.
Proof. Let f^k(n) denote iterates of 2*k + 1 with closed form f^k(n) = 2^k * n + 2^k - 1.
There are three cases for n:
1. If n is not a prime then f^0(n) = n is composite.
2. If n = 2 then f^5(2) = 95 is composite.
3. If n is an odd prime then f^(n-1)(n) = 2^(n-1) * n + 2^(n-1) - 1 is divisible by n since 2^(n-1) == 1 (mod n) by Fermat's theorem.
(End)

Examples

			a(2)=5 because 2, 5, 11, 23, 47 are prime but 95 is not.
		

Crossrefs

For records see A339581.
See also Cunningham chains, A005602, A005603.

Programs

  • Mathematica
    Table[Length[NestWhileList[2#+1&,n,PrimeQ[#]&]],{n,100}]-1 (* Harvey P. Dale, Aug 08 2020 *)
  • PARI
    a(n) = {if (! isprime(n), return (0)); d = 1; k = n; while(isprime(p = 2*k+1), k = p; d++;); return (d);} \\ Michel Marcus, Jul 22 2013

Formula

From Michael S. Branicky, Dec 24 2020: (Start)
See proof above.
a(n) = 0 if n == 0, 2, 4, 5, 6, 8 (mod 10), and n != 2 or 5.
a(n) <= 1 if n == 7 (mod 10).
a(n) <= 2 if n == 3 (mod 10).
a(n) <= 3 if n == 1 (mod 10).
(End)

Extensions

Term a(1) = 0 prepended by Antti Karttunen, Oct 09 2018.
Showing 1-10 of 21 results. Next