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

A010051 Characteristic function of primes: 1 if n is prime, else 0.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Keywords

Comments

The following sequences all have the same parity (with an extra zero term at the start of a(n)): a(n), A061007, A035026, A069754, A071574. - Jeremy Gardiner, Aug 09 2002
Hardy and Wright prove that the real number 0.011010100010... is irrational. See Nasehpour link. - Michel Marcus, Jun 21 2018
The spectral components (excluding the zero frequency) of the Fourier transform of the partial sequences {a(j)} with j=1..n and n an even number, exhibit a remarkable symmetry with respect to the central frequency component at position 1 + n/4. See the Fourier spectrum of the first 2^20 terms in Links, Comments in A289777, and Conjectures in A001223 of Sep 01 2019. It also appears that the symmetry grows with n. - Andres Cicuttin, Aug 23 2020

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 3.
  • V. Brun, Über das Goldbachsche Gesetz und die Anzahl der Primzahlpaare, Arch. Mat. Natur. B, 34, no. 8, 1915.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Oxford University Press, London, 1975.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 65.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 132.

Crossrefs

Cf. A051006 (constant 0.4146825... (base 10) = 0.01101010001010001010... (base 2)), A001221 (inverse Moebius transform), A143519, A156660, A156659, A156657, A059500, A053176, A059456, A072762.
First differences of A000720, so A000720 gives partial sums.
Column k=1 of A117278.
Characteristic function of A000040.
Cf. A008683.

Programs

  • Haskell
    import Data.List (unfoldr)
    a010051 :: Integer -> Int
    a010051 n = a010051_list !! (fromInteger n-1)
    a010051_list = unfoldr ch (1, a000040_list) where
       ch (i, ps'@(p:ps)) = Just (fromEnum (i == p),
                                  (i + 1, if i == p then ps else ps'))
    -- Reinhard Zumkeller, Apr 17 2012, Sep 15 2011
    
  • Magma
    s:=[]; for n in [1..100] do if IsPrime(n) then s:=Append(s,1); else s:=Append(s,0); end if; end for; s;
    
  • Magma
    [IsPrime(n) select 1 else 0: n in [1..100]];  // Bruno Berselli, Mar 02 2011
    
  • Maple
    A010051:= n -> if isprime(n) then 1 else 0 fi;
  • Mathematica
    Table[ If[ PrimeQ[n], 1, 0], {n, 105}] (* Robert G. Wilson v, Jan 15 2005 *)
    Table[Boole[PrimeQ[n]], {n, 105}] (* Alonso del Arte, Aug 09 2011 *)
    Table[PrimePi[n] - PrimePi[n-1], {n,50}] (* G. C. Greubel, Jan 05 2017 *)
  • PARI
    a(n)=isprime(n) \\ Charles R Greathouse IV, Apr 16 2011
    
  • Python
    from sympy import isprime
    def A010051(n): return int(isprime(n)) # Chai Wah Wu, Jan 20 2022

Formula

a(n) = floor(cos(Pi*((n-1)! + 1)/n)^2) for n >= 2. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 07 2002
Let M(n) be the n X n matrix m(i, j) = 0 if n divides ij + 1, m(i, j) = 1 otherwise; then for n > 0 a(n) = -det(M(n)). - Benoit Cloitre, Jan 17 2003
n >= 2, a(n) = floor(phi(n)/(n - 1)) = floor(A000010(n)/(n - 1)). - Benoit Cloitre, Apr 11 2003
a(n) = Sum_{d|gcd(n, A034386(n))} mu(d). [Brun]
a(m*n) = a(m)*0^(n - 1) + a(n)*0^(m - 1). - Reinhard Zumkeller, Nov 25 2004
a(n) = 1 if n has no divisors other than 1 and n, and 0 otherwise. - Jon Perry, Jul 02 2005
Dirichlet generating function: Sum_{n >= 1} a(n)/n^s = primezeta(s), where primezeta is the prime zeta function. - Franklin T. Adams-Watters, Sep 11 2005
a(n) = (n-1)!^2 mod n. - Franz Vrabec, Jun 24 2006
a(n) = A047886(n, 1). - Reinhard Zumkeller, Apr 15 2008
Equals A051731 (the inverse Möbius transform) * A143519. - Gary W. Adamson, Aug 22 2008
a(n) = A051731((n + 1)! + 1, n) from Wilson's theorem: n is prime if and only if (n + 1)! is congruent to -1 mod n. - N-E. Fahssi, Jan 20 2009, Jan 29 2009
a(n) = A166260/A001477. - Mats Granvik, Oct 10 2009
a(n) = 0^A070824, where 0^0=1. - Mats Granvik, Gary W. Adamson, Feb 21 2010
It appears that a(n) = (H(n)*H(n + 1)) mod n, where H(n) = n!*Sum_{k=1..n} 1/k = A000254(n). - Gary Detlefs, Sep 12 2010
Dirichlet generating function: log( Sum_{n >= 1} 1/(A112624(n)*n^s) ). - Mats Granvik, Apr 13 2011
a(n) = A100995(n) - sqrt(A100995(n)*A193056(n)). - Mats Granvik, Jul 15 2011
a(n) * (2 - n mod 4) = A151763(n). - Reinhard Zumkeller, Oct 06 2011
(n - 1)*a(n) = ( (2*n + 1)!! * Sum_{k=1..n}(1/(2*k + 1))) mod n, n > 2. - Gary Detlefs, Oct 07 2011
For n > 1, a(n) = floor(1/A001222(n)). - Enrique Pérez Herrero, Feb 23 2012
a(n) = mu(n) * Sum_{d|n} mu(d)*omega(d), where mu is A008683 and omega A001222 or A001221 indistinctly. - Enrique Pérez Herrero, Jun 06 2012
a(n) = A003418(n+1)/A003418(n) - A217863(n+1)/A217863(n) = A014963(n) - A072211(n). - Eric Desbiaux, Nov 25 2012
For n > 1, a(n) = floor(A014963(n)/n). - Eric Desbiaux, Jan 08 2013
a(n) = ((abs(n-2))! mod n) mod 2. - Timothy Hopper, May 25 2015
a(n) = abs(F(n)) - abs(F(n)-1/2) - abs(F(n)-1) + abs(f(n)-3/2), where F(n) = Sum_{m=2..n+1} (abs(1 - (n mod m)) - abs(1/2 - (n mod m)) + 1/2), n > 0. F(n) = 1 if n is prime, > 1 otherwise, except F(1) = 0. a(n) = 1 if F(n) = 1, 0 otherwise. - Timothy Hopper, Jun 16 2015
For n > 4, a(n) = (n-2)! mod n. - Thomas Ordowski, Jul 24 2016
From Ilya Gutkovskiy, Jul 24 2016: (Start)
G.f.: A(x) = Sum_{n>=1} x^A000040(n) = B(x)*(1 - x), where B(x) is the g.f. for A000720.
a(n) = floor(2/A000005(n)), for n>1. (End)
a(n) = pi(n) - pi(n-1) = A000720(n) - A000720(n-1), for n>=1. - G. C. Greubel, Jan 05 2017
Decimal expansion of Sum_{k>=1} (1/10)^prime(k) = 9 * Sum_{k>=1} pi(k)/10^(k+1), where pi(k) = A000720(k). - Amiram Eldar, Aug 11 2020
a(n) = 1 - ceiling((2/n) * Sum_{k=2..floor(sqrt(n))} floor(n/k)-floor((n-1)/k)), n>1. - Gary Detlefs, Sep 08 2023
a(n) = Sum_{d|n} mu(d)*omega(n/d), where mu = A008683 and omega = A001221. - Ridouane Oudra, Apr 12 2025
a(n) = 0 if (n^2 - 3*n + 2) * A000203(n) - 8 * A002127(n) > 0 else 1 (n>2, see Craig link). - Bill McEachen, Jul 04 2025

A005385 Safe primes p: (p-1)/2 is also prime.

Original entry on oeis.org

5, 7, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467, 479, 503, 563, 587, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439, 1487, 1523, 1619, 1823, 1907, 2027, 2039, 2063, 2099, 2207, 2447, 2459, 2579, 2819, 2879, 2903, 2963
Offset: 1

Views

Author

Keywords

Comments

Then (p-1)/2 is called a Sophie Germain prime: see A005384.
Or, primes of the form 2p+1 where p is prime.
Primes p such that denominator(Bernoulli(p-1) + 1/p) = 6. - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Feb 10 2004
Primes p such that p-1 is a semiprime. - Zak Seidov, Jul 01 2005
A156659(a(n)) = 1; A156875 gives numbers of safe primes <= n. - Reinhard Zumkeller, Feb 18 2009
From Daniel Forgues, Jul 31 2009: (Start)
A safe prime p is 7 or of the form 6k-1, k >= 1, i.e., p == 5 (mod 6).
A prime p of the form 6k+1, k >= 2, i.e., p = 1 (mod 6), cannot be a safe prime since (p-1)/2 is composite and divisible by 3. (End)
If k is the product of the n-th safe prime p and its corresponding Sophie Germain prime (p-1)/2, then a(n) = 2(k-phi(k))/3 + 1, where phi is Euler's totient function. - Wesley Ivan Hurt, Oct 03 2013
From Bob Selcoe, Apr 14 2014: (Start)
When the n-th prime is divided by all primes up to the (n-1)-th prime, safe primes (p) have remainders of 1 when divided by 2 and (p-1)/2 and no other primes. That is, p(mod j)=1 iff j={2,(p-1)/2}; p>j, {p,j}=>prime. Explanation: Generally, x(mod y)=1 iff x=y'+1, where y' is the set of divisors of y, y'>1. Since safe primes (p) are of the form p(mod j)=1 iff p and j are prime, then j={j'}. That is, since j is prime, there are no divisors of j (greater than 1) other than j. Therefore, no primes other than j exist which satisfy the equation p(mod j)=1.
Except primes of the form 2^n+1 (n>=0), all non-safe primes (p') will have at least one prime (p") greater than 2 and less than (p-1)/2 such that p'(mod p")=1. Explanation: Non-safe primes (p') are of the form p'(mod k)=1 where k is composite. This means prime divisors of k exist, and p" is the set of prime divisors of k (example p'=89: k=44; p"={2,11}). The exception applies because p"={2} iff p'=2^n+1.
Refer to the rows in triangle A207409 for illustration and further explanation. (End)
Conjecture: there is a strengthening of the Bertrand postulate for n >= 24: the interval (n, 2*n) contains a safe prime. It has been tested by Peter J. C. Moses up to n = 10^7. - Vladimir Shevelev, Jul 06 2015
The six known safe primes p such that (p-1)/2 is a Fibonacci prime are in A263880. - Jonathan Sondow, Nov 04 2015
The only term in common with A005383 is 5. - Zak Seidov, Dec 31 2015
From the fourth entry onward, do these correspond to Smarandache's problem 34 (see A007931 link), specifically values which cannot be used (do not meet conditions) to confirm the conjecture? - Bill McEachen, Sep 29 2016
Primes p with the property that there is a prime q such that p+q^2 is a square. - Zak Seidov, Feb 16 2017
It is conjectured that there are infinitely many safe primes, and their estimated asymptotic density ~ 2C/(log n)^2 (where C = 0.66... is the twin prime constant A005597) converges to the actual value as far as we know. - M. F. Hasler, Jun 14 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Except for the initial term, this is identical to A079148.
Subsequence of A088707.
Primes in A072055.

Programs

  • Haskell
    a005385 n = a005385_list !! (n-1)
    a005385_list = filter ((== 1) . a010051 . (`div` 2)) a000040_list
    -- Reinhard Zumkeller, Sep 18 2011
    
  • Magma
    [p: p in PrimesUpTo(3000) | IsPrime((p-1) div 2)]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    with(numtheory); [ seq(safeprime(i),i=1..3000) ]: convert(%,set); convert(%,list); sort(%);
    A005385_list := n->select(i->isprime(iquo(i,2)),select(i->isprime(i),[$1..n])): # Peter Luschny, Nov 08 2010
  • Mathematica
    Select[Prime[Range[1000]],PrimeQ[(#-1)/2]&] (* Zak Seidov, Jan 26 2011 *)
  • PARI
    g(n) = forprime(x=2,n,y=x+x+1;if(isprime(y),print1(y","))) \\ Cino Hilliard, Sep 12 2004
    
  • PARI
    [x|x<-primes(10^3), bigomega(x-1)==2] \\ Altug Alkan, Nov 04 2015
    
  • Python
    from sympy import isprime, primerange
    def aupto(limit):
      alst = []
      for p in primerange(1, limit+1):
        if isprime((p-1)//2): alst.append(p)
      return alst
    print(aupto(2963)) # Michael S. Branicky, May 07 2021

Formula

a(n) = 2 * A005384(n) + 1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 15 2001

A059455 Safe primes which are also Sophie Germain primes.

Original entry on oeis.org

5, 11, 23, 83, 179, 359, 719, 1019, 1439, 2039, 2063, 2459, 2819, 2903, 2963, 3023, 3623, 3779, 3803, 3863, 4919, 5399, 5639, 6899, 6983, 7079, 7643, 7823, 10163, 10799, 10883, 11699, 12203, 12263, 12899, 14159, 14303, 14699, 15803, 17939
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

Primes p such that both (p-1)/2 and 2*p+1 are prime.
Except for 5, all are congruent to 11 modulo 12.
Primes "inside" Cunningham chains of first kind.
Infinite under Dickson's conjecture. - Charles R Greathouse IV, Jul 18 2012
See A162019 for the subset of a(n) that are "reproduced" by the application of the transformations (a(n)-1)/2 and 2*a(n)+1 to the set a(n). - Richard R. Forberg, Mar 05 2015

Examples

			83 is a term because it is prime and 2*83+1 = 167 and (83-1)/2 = 41 are both primes.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(20000) |IsPrime((p-1) div 2) and IsPrime(2*p+1)]; // Vincenzo Librandi, Oct 31 2014
    
  • Mathematica
    lst={}; Do[p=Prime[n]; If[PrimeQ[(p-1)/2]&&PrimeQ[2*p+1], AppendTo[lst, p]], {n, 7!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 02 2008 *)
    Select[Prime[Range[1000]], AllTrue[{(# - 1)/2, 2 # + 1}, PrimeQ] &] (* requires Mathematica 10+; Feras Awad, Dec 19 2018 *)
  • PARI
    forprime(p=2,1e5,if(isprime(p\2)&&isprime(2*p+1),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from itertools import count, islice
    from sympy import isprime, prime
    def A059455_gen(): # generator of terms
        return filter(lambda p:isprime(p>>1) and isprime(p<<1|1),(prime(i) for i in count(1)))
    A059455_list = list(islice(A059455_gen(),10)) # Chai Wah Wu, Jul 12 2022

Formula

A156660(a(n))*A156659(a(n)) = 1; A156877 gives numbers of these numbers <= n. - Reinhard Zumkeller, Feb 18 2009

A059452 Safe primes (A005385) that are not Sophie Germain primes.

Original entry on oeis.org

7, 47, 59, 107, 167, 227, 263, 347, 383, 467, 479, 503, 563, 587, 839, 863, 887, 983, 1187, 1283, 1307, 1319, 1367, 1487, 1523, 1619, 1823, 1907, 2027, 2099, 2207, 2447, 2579, 2879, 2999, 3119, 3167, 3203, 3467, 3947, 4007, 4079, 4127, 4139, 4259, 4283
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

Except for 7, these primes are congruent to 11 modulo 12.
Terminal primes in complete Cunningham chains of first kind, i.e., the chains cannot be continued from these primes.

Examples

			347 is a term because 173 is a prime but 695 is not.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[(p-1)/2],If[ !PrimeQ[2*p+1],AppendTo[lst,p]]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 24 2009 *)
  • PARI
    is(p) = p > 2 && isprime(p) && isprime((p-1)/2) && !isprime(2*p+1); \\ Amiram Eldar, Jul 15 2024
  • Python
    from itertools import count, islice
    from sympy import isprime, prime
    def A059452_gen(): # generator of terms
        return filter(lambda p:isprime(p>>1) and not isprime(p<<1|1),(prime(i) for i in count(1)))
    A059452_list = list(islice(A059452_gen(),10)) # Chai Wah Wu, Jul 12 2022
    

Formula

A156659(a(n))*(1-A156660(a(n))) = 1. - Reinhard Zumkeller, Feb 18 2009

Extensions

Broken link updated by R. J. Mathar, Apr 12 2010

A156660 Characteristic function of Sophie Germain primes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 13 2009

Keywords

Crossrefs

Programs

  • Haskell
    a156660 n = fromEnum $ a010051 n == 1 && a010051 (2 * n + 1) == 1
    -- Reinhard Zumkeller, May 01 2012
    
  • PARI
    a(n)=isprime(n)&&isprime(2*n+1) \\ Felix Fröhlich, Aug 11 2014

Formula

a(n) = if n and also 2*n+1 is prime then 1 else 0.
a(A005384(n)) = 1; a(A138887(n)) = 0; a(A053176(n)) = 0.
A156874(n) = Sum_{k=1..n} a(k). - Reinhard Zumkeller, Feb 18 2009
a(n) = A010051(n)*A010051(2*n+1).
For n>1 a(n) = floor((floor(phi(n)/(n-1)) + floor(phi(2*n+1)/(2*n)))/2). - Enrique Pérez Herrero, Apr 28 2012
For n>1 a(n) = floor(phi(2*n^2+n)/(2*n^2-2*n)). - Enrique Pérez Herrero, May 02 2012

Extensions

Definition corrected by Daniel Forgues, Aug 04 2009

A059456 Unsafe primes: primes not in A005385.

Original entry on oeis.org

2, 3, 13, 17, 19, 29, 31, 37, 41, 43, 53, 61, 67, 71, 73, 79, 89, 97, 101, 103, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 173, 181, 191, 193, 197, 199, 211, 223, 229, 233, 239, 241, 251, 257, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

A010051(a(n))*(1-A156659(a(n))) = 1; subsequence of A156657. - Reinhard Zumkeller, Feb 18 2009
Also, primes p such that p-1 is a non-semiprime. - Juri-Stepan Gerasimov, Apr 28 2010
Conjecture: From the sequence of prime numbers, let 2 and remove the first data iteration of 2*p+1; leave 3 and remove the prime data by the iteration 2*p+1 and we get the sequence. Example for p=2, remove(5,11,23,47); p=3, remove(7); p=13, p=17, p=19, p=23, remove(47); and so on. - Vincenzo Librandi, Aug 07 2010

Examples

			31 is here because (31-1)/2=15 is not prime. 2 and 3 are here because 1/2 and 1 are not prime numbers.
		

Crossrefs

Initial terms for groups in A075712.

Programs

  • Mathematica
    Complement[Prime@ Range@ PrimePi@ Max@ #, #] &@ Select[Prime@ Range@ 90, PrimeQ[(# - 1)/2] &] (* Michael De Vlieger, May 01 2016 *)
    Select[Prime[Range[100]],PrimeOmega[#-1]!=2&] (* Harvey P. Dale, May 13 2018 *)
  • PARI
    is(n)=isprime(n) && !isprime(n\2) \\ Charles R Greathouse IV, May 02 2016

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Dec 29 2024

A059453 Sophie Germain primes (A005384) that are not safe primes (A005385).

Original entry on oeis.org

2, 3, 29, 41, 53, 89, 113, 131, 173, 191, 233, 239, 251, 281, 293, 419, 431, 443, 491, 509, 593, 641, 653, 659, 683, 743, 761, 809, 911, 953, 1013, 1031, 1049, 1103, 1223, 1229, 1289, 1409, 1451, 1481, 1499, 1511, 1559, 1583, 1601, 1733, 1811, 1889, 1901
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

Except for 2 and 3 these primes are congruent to 5 or 11 modulo 12.
Introducing terms of Cunningham chains of first kind.

Examples

			89 is a term because (89-1)/2 = 44 is not prime, but 2*89 + 1 = 179 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[ !PrimeQ[(p-1)/2],If[PrimeQ[2*p+1],AppendTo[lst,p]]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 24 2009 *)
    Select[Prime[Range[300]],PrimeQ[2#+1]&&!PrimeQ[(#-1)/2]&] (* Harvey P. Dale, Nov 10 2017 *)
  • PARI
    is(p) = isprime(p) && isprime(2*p+1) && if(p > 2, !isprime((p-1)/2), 1); \\ Amiram Eldar, Jul 15 2024
  • Python
    from itertools import count, islice
    from sympy import isprime, prime
    def A059453_gen(): # generator of terms
        return filter(lambda p:not isprime(p>>1) and isprime(p<<1|1),(prime(i) for i in count(1)))
    A059453_list = list(islice(A059453_gen(),10)) # Chai Wah Wu, Jul 12 2022
    

Formula

A156660(a(n))*(1-A156659(a(n))) = 1. - Reinhard Zumkeller, Feb 18 2009

A059500 Primes p such that both q=(p-1)/2 and 2p + 1 = 4q + 3 are composite numbers. Intersection of A059456 and A053176.

Original entry on oeis.org

13, 17, 19, 31, 37, 43, 61, 67, 71, 73, 79, 97, 101, 103, 109, 127, 137, 139, 149, 151, 157, 163, 181, 193, 197, 199, 211, 223, 229, 241, 257, 269, 271, 277, 283, 307, 311, 313, 317, 331, 337, 349, 353, 367, 373, 379, 389, 397, 401, 409, 421, 433, 439, 449
Offset: 1

Views

Author

Labos Elemer, Feb 05 2001

Keywords

Comments

Primes which are neither safe nor of Sophie Germain type.
Primes not in Cunningham chains of the first kind. - Alonso del Arte, Jun 30 2005
A010051(a(n))*(1-A156660(a(n)))*(1-A156659(a(n))) = 1; A156878 gives numbers of these numbers <= n. - Reinhard Zumkeller, Feb 18 2009

Examples

			Prime p=17 is here because both 35 and 8 are composite numbers. Such primes fall "out of" any Cunningham chain of first kind (or generate Cunningham chains of 0-length).
		

Crossrefs

Programs

  • Mathematica
    Complement[Prime[Range[100]], Select[Prime[Range[100]], PrimeQ[2# + 1] &], Select[Prime[Range[100]], PrimeQ[(# - 1)/2] &]] (Delarte)
    Select[Prime[Range[100]],!PrimeQ[q=2#+1]&&!PrimeQ[(#-1)/2]&] (* Zak Seidov, Mar 09 2013 *)
  • PARI
    is(n)=isprime(n)&&!isprime(n\2)&&!isprime(2*n+1) \\ Charles R Greathouse IV, Jan 16 2013

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jan 16 2013

A156875 Number of safe primes <= n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 18 2009

Keywords

Comments

a(n) = SUM(A156659(k): 1<=k<=n);
a(n) = A156874(floor((n-1)\2)).

Examples

			a(120) = #{5, 7, 11, 23, 47, 59, 83, 107} = 8.
		

Crossrefs

A156877 Number of primes <= n that are safe primes and also Sophie Germain primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 18 2009

Keywords

Examples

			a(120) = #{5, 11, 23, 83} = 4.
		

Crossrefs

Formula

a(n) = A156874(n) + A156875(n) - A156876(n).
a(n) = Sum_{k=1..n} A156659(k)*A156660(k).
Showing 1-10 of 13 results. Next