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 12 results. Next

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

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

A005603 Smallest prime beginning a complete Cunningham chain (of the second kind) of length n.

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

Comments

The chain begins with a prime number p; next term p' (a prime) is produced forming 2p-1; next term p"=2p'-1, etc. "Complete" means that each chain is exactly n primes long (i.e. the chain cannot be a subchain of another one). That is why this sequence is slightly different from A064812, where the 6th term (33301) is smaller than here (385591) but is the second one of a seven primes sequence and therefore doesn't *start* a sequence.
According to Augustin's web site, the numbers 107588900851484911, 69257563144280941, 3203000719597029781 are also in the sequence. - Dmitry Kamenetsky, May 14 2009

References

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

Crossrefs

See A064812 for another version.

Extensions

6th term corrected from 385591 on Feb 23 1995, at Robert G. Wilson v's suggestion
a(14) and a(15) found by Paul Jobling (Paul.Jobling(AT)WhiteCross.com) [Oct 23 2000]
a(6) reverted to original value by Sean A. Irvine, Jul 10 2016
a(16) from Augustin's page, comment corrected by Jens Kruse Andersen, Jun 14 2014
Edited by N. J. A. Sloane, Nov 03 2018 at the suggestion of Georg Fischer, Nov 03 2018, merging a duplicate entry with this one.
In Augustin's web page there are 7 or so more terms which could be added here, or alternatively used to create a b-file. - Georg Fischer, Nov 03 2018

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 *)

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

A181715 Length of the complete Cunningham chain of the second kind starting with prime(n).

Original entry on oeis.org

3, 2, 1, 2, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1
Offset: 1

Views

Author

M. F. Hasler, Nov 17 2010

Keywords

Comments

Number of iterations x -> 2x-1 needed to get a composite number, when starting with prime(n).
Dickson's conjecture implies that, for every positive integer r, there exist infinitely many n such that a(n) = r. - Lorenzo Sauras Altuzarra, Feb 12 2021
a(n) is the least k such that 2^k * (prime(n)-1) + 1 is composite. Note that a(n) is well defined since 2^(p-1) * (p-1) + 1 is divisible by p for odd primes p. - Jianing Song, Nov 24 2021

Examples

			2 -> 3 -> 5 -> 9 = 3^2, so a(1) = 3 and a(2) = 2. - _Jonathan Sondow_, Oct 30 2015
		

Crossrefs

Programs

  • Maple
    a := proc(n)
       local c, l:
       c, l := 0, ithprime(n):
       while isprime(l) do c, l := c+1, 2*l-1: od:
       c:
    end: # Lorenzo Sauras Altuzarra, Feb 12 2021
  • Mathematica
    Table[p = Prime[n]; cnt = 1; While[p = 2*p - 1; PrimeQ[p], cnt++]; cnt, {n, 100}] (* T. D. Noe, Jul 12 2012 *)
    Table[-1 + Length@ NestWhileList[2 # - 1 &, Prime@ n, PrimeQ@ # &], {n, 98}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    a(n)= n=prime(n); for(c=1,1e9, is/*pseudo*/prime(n=2*n-1) || return(c))

Formula

a(n) < prime(n) for n > 1; see Löh (1989), p. 751. - Jonathan Sondow, Oct 28 2015
max(a(n), A181697(n)) = A263879(n) for n > 2. - Jonathan Sondow, Oct 30 2015
a(n) = A285700(A000040(n)). - Antti Karttunen, Apr 26 2017

Extensions

Escape clause added to definition by N. J. A. Sloane, Feb 19 2021
Escape clause deleted from definition by Jianing Song, Nov 24 2021

A064812 Smallest prime p such that the infinite sequence {p, p'=2p-1, p''=2p'-1, ...} begins with a string of exactly n primes.

Original entry on oeis.org

5, 3, 2, 2131, 1531, 33301, 16651, 15514861, 857095381, 205528443121, 1389122693971, 216857744866621, 758083947856951, 107588900851484911, 69257563144280941
Offset: 1

Views

Author

David Terr, Oct 21 2002

Keywords

Comments

Chains of length n of nearly doubled primes.
Smallest prime beginning a complete Cunningham chain of length n of the second kind. (For the first kind see A005602.) - Jonathan Sondow, Oct 30 2015

Examples

			a(3) = 2 because 2 is the smallest prime such that the sequence {2, 3, 5, 9, ...} begins with exactly 3 primes, where each term in the sequence is twice the preceding term minus 1.
		

Crossrefs

A336060 Numbers p such that p, 2p-1, 3p-2, 4p-3, 5p-4, 6p-5, 7p-6, 8p-7 are primes.

Original entry on oeis.org

512821, 22240681, 26486461, 99597961, 593009341, 1021157551, 1041298441, 1281196561, 1349985001, 1426148011, 1660907431, 1894757971, 2544774541, 3590232241, 3958824871, 4012463281, 4219580191, 4363137241, 6482599411, 7178651971, 8051820421, 8417194381
Offset: 1

Views

Author

Jeppe Stig Nielsen, Jul 07 2020

Keywords

Comments

Each term is 1 modulo 210.
The subset p, 2p-1, 4p-3, 8p-7 is a Cunningham chain of the 2nd kind, cf. A057327.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[387*10^6]],AllTrue[Table[n #-(n-1),{n,2,8}],PrimeQ]&] (* Harvey P. Dale, Mar 01 2023 *)
Showing 1-10 of 12 results. Next