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-4 of 4 results.

A080840 Number of cousin primes < 10^n.

Original entry on oeis.org

1, 8, 41, 203, 1216, 8144, 58622, 440258, 3424680, 27409999, 224373161, 1870585459, 15834656003, 135779962760, 1177207270204
Offset: 1

Views

Author

Jason Earls, Mar 28 2003

Keywords

Comments

The corresponding numbers for twin primes and sexy primes are in A007508 and A080841, the greater of twin primes, cousin primes and sexy primes are in A006512, A046132 and A046117 respectively.
In this sequence, only the upper member of each prime cousin pair is counted. See A152052 for the variant where only the lower member is counted. - James Rayman, Jan 17 2021

Crossrefs

Programs

  • PARI
    {c=0; p=5; for(n=1,9, while(p<10^n,if(isprime(p-4),c++); p=nextprime(p+1)); print1(c,","))}

Extensions

a(8) and a(9) from Klaus Brockhaus, Mar 30 2003
More terms from R. J. Mathar, Aug 05 2007
a(13)-a(15) from Martin Ehrenstein, Sep 03 2021

A152127 Sum of cousin primes < 10^n.

Original entry on oeis.org

28, 766, 34522, 1706602, 107863996, 7379208796, 542100094312, 41248685420836, 3233516261489332, 260607555289408894, 21446383929686290726, 1795656778320649469818, 152541729206365604807782
Offset: 1

Views

Author

Cino Hilliard, Nov 25 2008

Keywords

Comments

Cousin primes are prime pairs that differ by 4. The convention here is to count a cousin pair as long as the first cousin of the pair is less than or equal to the specified bound which in this sequence is 10^n.
"According to the first Hardy-Littlewood conjecture, the cousin primes have the same asymptotic density as the twin primes." See the MathWorld link. The (sum of cousin prime pairs < 10^n)/4 ~ number of cousin primes < 10^2n.

Examples

			(3,7) and (7,11) are the cousin primes < 10. These add up to 28 the first entry in the sequence.
		

Crossrefs

Programs

  • PARI
    lista(pmax) = {my(sm = 10, prev = 2, pow = 10); forprime(p = 3, pmax, if(p == prev + 4, sm += (prev + p)); if(p > pow, print1(sm, ", "); pow *= 10); prev = p);} \\ Amiram Eldar, Jul 06 2024

Extensions

Data corrected by Amiram Eldar, Jul 06 2024

A240167 Lesser of the first cousin prime pair with n digits.

Original entry on oeis.org

3, 13, 103, 1009, 10099, 100189, 1000033, 10000453, 100000123, 1000000093, 10000000597, 100000000069, 1000000000189, 10000000000279, 100000000001173, 1000000000000399, 10000000000001719, 100000000000002733, 1000000000000002493, 10000000000000000087
Offset: 1

Views

Author

Abhiram R Devesh, Aug 02 2014

Keywords

Comments

Sum of reciprocals converges towards 0.421066...
It is only a (plausible) conjecture that this sequence is well-defined. See A152052. - N. J. A. Sloane, Aug 22 2014

Crossrefs

Programs

  • PARI
    a(n)=my(p=nextprime(10^(n-1))); while(!isprime(p+4), p=nextprime(p+1)); return(p)
    vector(50, n, a(n)) \\ Derek Orr, Aug 04 2014
  • Python
    import sympy
    for i in range(100):
        a=(10**i)
        p=sympy.nextprime(a)
        while not sympy.isprime(p+4):
            p=sympy.nextprime(p)
        print(p)
    

Formula

For n > 1, a(n) = 10^(n-1) + A227432(n-1), assuming a(n) exists. - Jens Kruse Andersen, Aug 22 2014

A240170 Larger of the greatest cousin prime pair with n digits.

Original entry on oeis.org

7, 83, 971, 9887, 99881, 999983, 9999401, 99999551, 999999761, 9999999707, 99999999947, 999999998867, 9999999999083, 99999999999467, 999999999997841, 9999999999997031, 99999999999998717, 999999999999999161, 9999999999999996587, 99999999999999999803
Offset: 1

Views

Author

Abhiram R Devesh, Aug 02 2014

Keywords

Comments

The sum of the reciprocals converges to 0.156047....
It is only a (plausible) conjecture that this sequence is well-defined. See A152052. - N. J. A. Sloane, Aug 22 2014

Crossrefs

Analogous sequences with twin primes:
- A092245 Lesser of the first twin prime pair with n digits.
- A114429 Larger of the greatest twin prime pair with n digits.

Programs

  • PARI
    a(n)=p=precprime(10^n);while(!isprime(p-4),p=precprime(p-1));return(p)
    vector(50, n, a(n)) \\ Derek Orr, Aug 04 2014
  • Python
    import sympy
    for i in range(1,100):
        a=(10**i)
        p=sympy.prevprime(a)
        while sympy.isprime(p-4)==False:
            p=sympy.prevprime(p)
        print(p)
    
Showing 1-4 of 4 results.