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 41-50 of 66 results. Next

A261533 Primes p such that p+2 is prime with prime(p+2)-prime(p)=6.

Original entry on oeis.org

3, 5, 59, 2789, 5231, 6947, 8087, 11717, 15269, 16229, 17207, 17909, 18059, 18131, 24917, 28751, 35279, 37307, 39227, 39239, 41201, 43787, 45821, 47741, 51869, 53087, 53609, 58439, 64577, 69857, 70919, 75707, 79631, 84869, 92381, 93479, 96179, 102197, 102929, 106187
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 23 2015

Keywords

Comments

The conjecture in A261528 implies that the current sequence has infinitely many terms.
Note that for each n > 2 the difference prime(n+2)-prime(n) is at least 6.

Examples

			a(1) = 3 since 3 and 3+2 = 5 are twin prime, and prime(5)-prime(3) = 11-5 = 6.
a(2) = 5 since 5 and 5+2 = 7 are twin prime, and prime(7)-prime(5) = 17-11 = 6.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    f[n_]:=Prime[n]
    PQ[k_]:=PrimeQ[f[k]+2]&&f[f[k]+2]-f[f[k]]==6
    n=0;Do[If[PQ[k],n=n+1;Print[n," ",f[k]]],{k,1,10119}]
    Select[Partition[Prime[Range[11000]],2,1],#[[2]]-#[[1]]==2&&Prime[#[[1]]+ 2]- Prime[#[[1]]]==6&][[All,1]] (* Harvey P. Dale, Apr 26 2020 *)
  • PARI
    isok(i)=p=prime(i);isprime(p+2)&&prime(p+2)-prime(p)==6;
    first(m)=my(v=vector(m));i=1;for(j=1,m,while(!isok(i),i++);v[j]=prime(i);i++);v; \\ Anders Hellström, Aug 23 2015

A276835 Numerator of a modified exponentiated von Mangoldt function defined recursively.

Original entry on oeis.org

1, 2, 3, 2, 5, 1, 7, 1, 3, 1, 11, 1, 13, 1, 1, 6, 17, 3, 19, 4, 1, 3, 23, 90, 5, 5, 3, 3, 29, 12, 31, 112, 3, 105, 1, 50, 37, 5, 1, 27, 41, 81, 43, 10, 1, 105, 47, 539, 7, 77, 15, 4, 265, 2, 3, 520, 3, 351, 59, 945
Offset: 1

Views

Author

Mats Granvik, Sep 20 2016

Keywords

Comments

Conjecture: For n>3: If and only if the ratio A276835(n)/A276836(n) is equal to n then n is equal to the greater of the twin primes A006512.
Justification: Whenever n is equal to the greater of the twin primes then in the recurrence that defines the table t(n,k) at k=1 the Product_{i=1..n-1} t(n,k+i)=1, and Product_{i=1..n-1} t(n-2,k+i) = 1 because by definition of a prime the only divisors are 1 (at n=k in table t(n,k)) and the prime itself (at k=1 in the table t(n,k)) and thereby n/Product_{i=1..n-1}t(n,k+i)/Product_{i=1..n-1}t(n-2,k+i) = n. Since the exponentiated von Mangoldt function is the unique arithmetic function such that when multiplied over the divisors, is equal to n, and since the exponentiated von Mangoldt function is equal to n at prime numbers only, and since at n not equal to the greater of the twin primes the modified recurrence for the exponentiated von Mangoldt function by recursion messes with the output so much that the output cannot possibly be equal to n at any other numbers than at n equal to the greater of the twin primes.
Setting x = 1 gives ratios A276835(n)/A276836(n) equal to n when n is equal to the greater of the twin primes A006512.
Setting x = 2 gives ratios A276835(n)/A276836(n) equal to n when n is equal to A046132.
Setting x = 3 gives ratios A276835(n)/A276836(n) equal to n when n is equal to A046117.
Setting x = 4 gives ratios A276835(n)/A276836(n) equal to n when n is equal to A092402, and so on.

Examples

			The ratio A276835/A276836 starts: 1, 2, 3, 2, 5, 1/2, 7, 1/3, 3, 1/4, 11/3, 1/5, 13,...
The greater twin primes A006512 start: 5,7,13,... where the ratio is equal to n.
		

Crossrefs

Programs

  • Mathematica
    Clear[t, x]; (*setting x=1 gives ratio equal to n when n is the greater of the twin primes, x=2 gives ratio equal to n when n is the greater of the cousin primes and so on.*) x = 1; nn = 60; t[1, 1] = 1; t[n_, k_] := t[n, k] = If[k == 1, n/Product[t[n - 2*x, k + i], {i, 1, n - 2*x}]/Product[t[n, k + i], {i, 1, n - 1}], If[Mod[n, k] == 0, t[n/k, 1], 1], 1]; Monitor[a = Table[t[n, 1], {n, 1, nn}];, n]; Numerator[a] (* Mats Granvik, Sep 20 2016, Sep 29 2016 *)

Formula

From Mats Granvik, Sep 20 2016, Sep 29 2016: (Start)
Recurrence for the ratio A276835(n)/A276836(n):
Let:
x = 1;
T(1, 1) = 1;
T(n, k) = If k = 1 then n/Product_{i=1..n-2*x}(T(n-2*x, k + i))/Product_{i=1..n-1}(T(n, k + i)) else if Mod(n, k) = 0 then T(n/k, 1) else 1 else 1.
Then A276835(n)/A276836(n) = T(n,1). (End)

A338812 Smaller term of a pair of sexy primes (A023201) such that the distance to next pair (A227346) is a square.

Original entry on oeis.org

7, 13, 37, 97, 103, 223, 307, 331, 457, 541, 571, 853, 877, 1087, 1297, 1423, 1483, 1621, 1867, 1993, 2683, 3457, 3511, 3691, 3761, 3847, 4513, 4657, 4783, 4951, 5227, 5521, 5647, 5861, 6337, 6547, 6823, 7481, 7541, 7681, 7717, 7753, 7873, 8287, 8521, 8887, 9007, 9397, 10267, 10453
Offset: 1

Views

Author

Claude H. R. Dequatre, Nov 10 2020

Keywords

Comments

Considering the 10^6 sexy prime pairs from (5,11) to (115539653,115539659), we note the following:
65340 sequence terms (6.5%) are linked to a distance between two consecutive sexy prime pairs which is a square.
List of the 16 classes of distances which are squares: 4,16,36,64,100,144,196,256,324,400,484,576,676,784,900,1024.
The frequency of the distances which are squares decreases when their size increases, with a noticeable higher frequency for the distance 36.
First 20 distances which are squares with in parentheses the subtraction of the smallest members of the related two consecutive sexy prime pairs: 4 (11-7), 4 (17-13),4 (41-37),4 (101-97),4 (107-103),4 (227-223),4 (311-307), 16 (347-331),4 (461-457),16 (557-541),16 (587-571),4 (857-853), 4 (881-877), 4 (1091-1087),4 (1301-1297),4 (1427-1423),4 (1487-1483),36 (1657-1621), 4 (1871-1867),4 (1997-1993).

Examples

			a(2)=13 is in the sequence because the two consecutive sexy prime pairs being (13,19) and (17,23),the distance between them is 17-13=4 which is a square (2^2).
73 is not in the sequence because the two consecutive sexy prime pairs being (73,79) and (83,89),the distance between them is 83-73=10 which is not a square.
		

Crossrefs

Programs

  • Maple
    count:= 0: sp:= 5: R:= NULL:
    p:= sp;
    while count < 100  do
        p:= nextprime(p);
        if isprime(p+6) then
          d:= p - sp;
          if issqr(d) then
            count:= count+1; R:= R, sp;
          fi;
          sp:= p;
        fi;
    od:
    R; # Robert Israel, May 08 2024
  • PARI
    lista(nn) = {my(vs = select(x->(isprime(x) && isprime(x+6)), [1..nn]), vd = vector(#vs-1, k, vs[k+1] - vs[k]), vk = select(issquare, vd, 1)); vector(#vk, k, vs[vk[k]]);} \\ Michel Marcus, Nov 14 2020
  • R
    primes<-generate_n_primes(7000000)
    Matrix_1<-matrix(c(primes),nrow=7000000,ncol=1,byrow=TRUE)
    p1<-c(0)
    p2<-c(0)
    k<-c(0)
    distance<-c(0)
    distance_square<-(0)
    Matrix_2<-cbind(Matrix_1,p1,p2,k,distance,distance_square)
    counter=0
    j=1
    while(j<= 7000000){
      p<-(Matrix_2[j,1])+6
      if(is_prime(p)){
        counter=counter+1
        Matrix_2[counter,2]<-(p-6)
        Matrix_2[counter,3]<-p
      }
      j=j+1
    }
    a_n<-c()
    k=1
    while(k<=1000000){
      Matrix_2[k,4]<-k
      dist<-Matrix_2[k+1,2]-Matrix_2[k,2]
      Matrix_2[k,5]<-dist
      if(sqrt(dist)%%1==0){
        Matrix_2[k,6]<-dist
        a_n<-append(a_n,Matrix_2[k,2])
      }
      k=k+1
    }
    View(Matrix_2)
    View(a_n)
    

A094231 Lesser member p of sexy primes (p, p+6) such that (p+1, p+2, p+3, p+4, p+5) all have the same number of prime divisors (counted with multiplicity).

Original entry on oeis.org

601, 42181, 70201, 240953, 277493, 414361, 418793, 619813, 632147, 637073, 723161, 732233, 739433, 761393, 781961, 879001, 934481, 979201, 1154233, 1320721, 1327673, 1357673, 1611361, 1685521, 1866233, 1877833, 1950457
Offset: 1

Views

Author

Jason Earls, May 29 2004

Keywords

Examples

			42181 is a term because 42181 and 42187 are sexy primes while 42182-42186 each have 4 prime divisors (counting multiplicity).
		

Crossrefs

Programs

  • Magma
    f:=func; [p:p in PrimesUpTo(2000000)| IsPrime(p+6) and forall{k:k in [2..5]|f(p+k) eq f(p+1)} ]; // Marius A. Burtea, Dec 16 2019
  • Mathematica
    Select[Range[2*10^6],AllTrue[{#,#+6},PrimeQ]&&Length[Union[ PrimeOmega[ Range[ #+1,#+5]]]]==1&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 16 2015 *)

A098933 Primes of the form p+14, where p is a prime.

Original entry on oeis.org

17, 19, 31, 37, 43, 61, 67, 73, 97, 103, 127, 151, 163, 181, 193, 211, 241, 271, 277, 283, 307, 331, 367, 373, 397, 433, 457, 463, 523, 571, 577, 601, 607, 613, 631, 661, 673, 691, 733, 757, 787, 811, 823, 853, 877, 967, 991, 997, 1033, 1063, 1117, 1123, 1201
Offset: 1

Views

Author

Douglas Winston (douglas.winston(AT)srupc.com), Oct 20 2004

Keywords

Crossrefs

Programs

  • PARI
    isok(n) = isprime(n) && isprime(n - 14) \\ Michel Marcus, Jul 17 2013

A172072 Numbers k such that either prime(k) - 5/2 +- 7/2 is prime.

Original entry on oeis.org

1, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 19, 21, 22, 24, 27, 28, 29, 30, 33, 37, 38, 40, 41, 45, 46, 50, 51, 52, 55, 56, 57, 59, 61, 65, 66, 68, 71, 72, 74, 75, 77, 85, 87, 90, 91, 97, 101, 103, 104, 106, 108, 109, 111, 112, 114, 118, 119, 120, 124, 130, 131, 134, 144
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 25 2010

Keywords

Comments

Also: 1 plus numbers k such that prime(k) - 6 is prime. - Michael S. Branicky, Aug 16 2025

Examples

			a(1) = 1 because prime(1)-5/2-7/2 = 2-5/2-7/2 = -4 (nonprime) and prime(1)-5/2+7/2 = 2-5/2+7/2 = 3 (prime).
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Select[Range[5, 150], PrimeQ[Prime[#] - 6] &]] (*  Paolo Xausa, Aug 17 2025 *)
  • PARI
    is(n,p=prime(n))=isprime(p-6) || isprime(p+1) \\ Charles R Greathouse IV, Jun 13 2017
    
  • Python
    from sympy import isprime, prime
    def ok(n): return n == 1 or isprime(prime(n)-6)
    print([k for k in range(1, 145) if ok(k)]) # Michael S. Branicky, Aug 16 2025

Extensions

Corrected (57 inserted) by R. J. Mathar, May 02 2010

A236552 a(n) = |{0 < k < n: 6*k - 1, 6*k + 1, 6*k + 5 and prime(n-k) + 6 are all prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 28 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any integer n > 4, there is a positive integer k < n such that 6*k - 5, 6*k - 1, 6*k + 1 and prime(n-k) + 6 are all prime.
(iii) Any integer n > 7 can be written as p + q with q > 0 such that p, p + 6 and prime(q) + 6 are all prime.
(iv) Each integer n > 4 can be written as k*(k+1) + m with k > 0 and m > 0 such that prime(m) + 6 is prime.

Examples

			a(4) = 1 since 6*1 - 1, 6*1 + 1, 6*1 + 5 and prime(4-1) + 6 = 11 are all prime.
a(48) = 1 since 6*32 - 1 = 191, 6*32 + 1 = 193, 6*32 + 5 = 197 and prime(48-32) + 6 = 53 + 6 = 59 are all prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[6n-1]&&PrimeQ[6n+1]&&PrimeQ[6n+5]
    q[n_]:=PrimeQ[Prime[n]+6]
    a[n_]:=Sum[If[p[k]&&q[n-k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A341843 Number of sexy consecutive prime pairs below 2^n.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 7, 13, 25, 45, 80, 136, 251, 443, 784, 1377, 2420, 4312, 7756, 14106, 25554, 46776, 85774, 157325, 290773, 538520, 1000321, 1861364, 3473165, 6493997, 12167342, 22851920, 42987462, 81018661, 152945700, 289206487, 547722346, 1038786862
Offset: 1

Views

Author

Artur Jasinski, Feb 21 2021

Keywords

Comments

a(n) is the number of pairs of consecutive sexy primes {A023201, A046117} less than 2^n.
For each n from 9 through 48, the most frequently occurring difference between consecutive primes is 6. On p. 108 of the article by Odlyzko et al., the authors estimate that around n=117, the jumping champion (i.e., the most frequently occurring difference between consecutive primes) becomes 30, and around n=1412 it becomes 210. Successive jumping champions are conjecturaly the primorial numbers A002110.
Data for n >= 15 taken from Marek Wolf's prime gaps computation.
For the number of pairs of consecutive primes below 10^n having a difference of 6, see A093738.
For the number of sexy primes less than 10^n, see A080841.
There are 8 known cases in which a power of 2 falls between the members of the sexy consecutive prime pair (see A220951), but if a pair (p, p+6) is such that p < 2^n < p+6, that pair is not counted in a(n).

Examples

			a(6)=4 because 2^6=64 and we have 4 sexy consecutive prime pairs less than 64: {23,29}, {31,37}, {47,53}, {53,59}.
		

Crossrefs

Programs

  • Mathematica
    pp = {}; Do[kk = 0; Do[If[Prime[m + 1] - Prime[m] == 6, kk = kk + 1], {m, 2, PrimePi[2^n] - 1}]; AppendTo[pp, kk], {n, 4, 20}]; pp

A360016 Number of partitions of 4*n into four odd primes (p_1, p_2, p_3, p_4) (p_1 < p_2 <= p_3 < p_4 and p_1 + p_4 = p_2 + p_3 = 2*n) such that (p_1, p_2) and (p_3, p_4) are consecutive pairs of prime numbers with the same difference, d = p_2 - p_1 = p_4 - p_3, and (p_1, p_3), (p_2, p_4) are also consecutive pairs of prime numbers with the same difference, D = p_3 - p_1 = p_4 - p_2.

Original entry on oeis.org

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

Views

Author

Naohiro Nomoto, Jan 21 2023

Keywords

Comments

Two pairs of primes, (q, r) and (s, t), are consecutive pairs of primes with the same difference d = r - q = t - s if there exists no other pair of primes (u, v) having the same difference d and lying between the pairs (q, r) and (s, t).

Examples

			a(57)=2 because there are two such partitions of 228: {43,47,67,71}, {43,53,61,71}.
In the first partition (i.e., p_1 = 43, p_2 = 47, p_3 = 67, p_4 = 71), (43,47) and (67,71) are prime pairs with difference 4 (since p_2 - p_1 = p_4 - p_3 = 4), and they are consecutive among such pairs (i.e., there does not exist any intervening pair of primes with difference 4). It is also true that (43,67) and (47,71) are prime pairs with difference 24 (since p_3 - p_1 = p_4 - p_2 = 24), and they are consecutive among such pairs (i.e., no intervening pair of primes with difference 24 exists).
Similarly, in the second partition (i.e., p_1 = 43, p_2 = 53, p_3 = 61, p_4 = 71), (43,53) and (61,71) are consecutive pairs of prime numbers with difference 10: p_2 - p_1 = p_4 - p_3 = 10, and (43,61) and (53,71) are consecutive pairs of prime numbers with difference 18: p_3 - p_1 = p_4 - p_2 = 18.
		

Crossrefs

Programs

  • PARI
    chk(s, t, d)={forprime(p=s, t, if(isprime(p+d), return(0))); 1}
    a(n) = {my(s=0); forprime(p=3, n, if(isprime(2*n-p), forprime(q=p+1, n, if(isprime(2*n-q) && chk(p+1, 2*n-q-1, q-p) && chk(p+1,q-1,2*n-q-p), s++)))); s} \\ Andrew Howroyd, Feb 03 2023

A372042 Monogamously Faithful Primes (primes that are sexy primes with only one other prime in their pair).

Original entry on oeis.org

83, 89, 131, 137, 191, 193, 197, 199, 223, 229, 307, 311, 313, 317, 331, 337, 383, 389, 433, 439, 443, 449, 457, 461, 463, 467, 503, 509, 541, 547, 571, 577, 677, 683, 751, 757, 821, 823, 827, 829, 853, 857, 859, 863, 877, 881, 883, 887, 991, 997, 1013, 1019, 1033, 1039, 1063, 1069, 1087
Offset: 0

Views

Author

Ryan Stoler, Apr 17 2024

Keywords

Comments

These are all the numbers found in A136207 but not found in A046118, A046119, A046120, A023271, A046122, A046123, or A046124, i.e., members of a sexy prime pair but not members of sexy prime triplets, quadruplets, ...

Examples

			83 and 89 are "sexy" with each other, because they differ by 6. They are monogamously faithful, because neither is sexy with any other number.
71 is not "sexy" because it is not in A136207.
67 is "sexy" with both 61 and 73. Therefore, it is not monogamously faithful, since it has multiple numbers that it is sexy with.
43 is "sexy" only with 37. But it is not monogamously faithful, even though it isn't sexy with another number, because 37 is also "sexy" with 31, therefore "cheating" on 43 with 31.
		

Crossrefs

Programs

  • Maple
    isA372042 := proc(n)
        if isprime(n) then
            if isprime(n+6) then
                if not isprime(n-6) and not isprime(n+12) then
                    true;
                else
                    false;
                end if;
            elif isprime(n-6) then
                if not isprime(n+6) and not isprime(n-12) then
                    true;
                else
                    false;
                end if;
            else
                false ;
            end if;
        else
            false ;
        end if;
    end proc:
    A372042 := proc(n)
        option remember;
        local a;
        if n = 1 then
            83 ;
        else
            a := nextprime(procname(n-1)) ;
            while true do
                if isA372042(a) then
                    return a;
                else
                    a := nextprime(a) ;
                end if;
            end do:
        end if;
    end proc:
    seq(A372042(n),n=1..80) ; # R. J. Mathar, Jun 10 2024
Previous Showing 41-50 of 66 results. Next