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 21-30 of 108 results. Next

A079164 Twin-primorial numbers: running products of twin primes.

Original entry on oeis.org

3, 15, 75, 525, 5775, 75075, 1276275, 24249225, 703227525, 21800053275, 893802184275, 38433493923825, 2267576141505675, 138322144631846175, 9820872268861078425, 716923675626858725025, 72409291238312731227525
Offset: 1

Views

Author

Cino Hilliard, Feb 03 2003

Keywords

Comments

The sum of the reciprocals converges to 0.4154254016622336549103692152614908366885449298862362851444631680740051...

Examples

			The first two twin primes are 3 and 5, so the first term is 3 and the second term is 15.  The next two twin primes are 5 and 7, so the third term is 5*15=75 and the fourth term is 75*7=525
		

Crossrefs

Partial products of A077800.

Programs

  • Mathematica
    Rest[FoldList[Times,1,Flatten[Select[Partition[Prime[Range[30]], 2,1], Last[#]-First[#]==2&]]]] (* Harvey P. Dale, Mar 16 2011 *)
  • PARI
    twprfact(n) = {sr=0; tp = vector(10000); k=1; forprime(j = 3,n, if(nextprime(j+1)-j == 2, tp[k] = j; tp[k+1] = j+2; k+=2; ); ); for(j=1,k-1, y=1; for(i = 1,j, y*=tp[i]; ); print1(y", "); sr+=1.0/y; ); print(); print(sr); }

Extensions

Definition clarified and example provided by Harvey P. Dale, Mar 16 2011

A097490 Primes which are two greater than A097489 terms.

Original entry on oeis.org

5, 17, 167, 302946354048717875530381041444257, 17164738545781348456175905084853738838912866540727619406614703260339837793050935010265073947
Offset: 1

Views

Author

Cino Hilliard, Aug 24 2004

Keywords

Examples

			a(3) = 167 = (Product_{k=1..3} A001359(k)) + 2 = 3 * 5 * 11 + 2 = A097489(3) + 2. - _Hartmut F. W. Hoft_, Apr 27 2021
		

Crossrefs

Programs

  • Mathematica
    step[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p+2], {{p,p+2}}, {}]], p}]
    smallerTwin[n_] := First[Transpose[First[NestWhile[step, {{{3, 5}}, 3}, Length[First[step[#]]]<=n&]]]]
    a097489[n_] := Rest[FoldList[Times, 1, smallerTwin[n]]]
    a097490[n_] := Select[Map[#+2&, a097489[n]], PrimeQ]
    a097490[39] (* Hartmut F. W. Hoft, Apr 27 2021 *)
  • PARI
    fp(n) = p=1;for(x=1,n,p*=twinl(x);if(isprime(p+2),print1(p+2", ")))
    twinl(n) = { local(c,x); c=0; x=1; while(c
    				

Extensions

Edited by Don Reble, Apr 16 2007

A097491 Primes which are two greater than the terms of A079164.

Original entry on oeis.org

5, 17, 21800053277, 72409291238312731227527, 86984485062381462583582279727, 21679097826151232817152558557032490897727272048343000297777, 107025222275017133994159705286756083545279583250537082122450588876727
Offset: 1

Views

Author

Cino Hilliard, Aug 24 2004

Keywords

Comments

A097491(8) = 2948...794027 has 76 digits and A097491(9) = 152400...802327 has 288 digits. - Hartmut F. W. Hoft, Apr 27 2021

Examples

			a(3) = 21800053277 = A079164(17) + 2 = 3*5*5*7*11*13*17*19*29*31 + 2. - _Hartmut F. W. Hoft_, Apr 27 2021
		

Crossrefs

Programs

  • Mathematica
    step[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p+2], {{p,p+2}}, {}]], p}]
    pairList[n_] := First[NestWhile[step, {{{3, 5}}, 3}, Length[First[step[#]]]<=n&]]
    a079164[n_] := Rest[FoldList[Times, 1, Take[Flatten[pairList[n]], n]]]
    a097491[n_] := Select[Map[#+2&, a079164[n]], PrimeQ]
    a097491[39] (* Hartmut F. W. Hoft, Apr 27 2021 *)
  • PARI
    ft(n) = p=1;for(x=1,n,p*=twinl(x);if(isprime(p+2),print1(p+2", ")); p*=twinu(x);if(isprime(p+2),print1(p+2", ")))
    twinl(n) = { local(c,x); c=0; x=1; while(c
    				

Extensions

Edited by Don Reble, Apr 16 2007
Name corrected by Hartmut F. W. Hoft, Apr 27 2021

A179067 Orders of consecutive clusters of twin primes.

Original entry on oeis.org

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

Views

Author

Franz Vrabec, Jun 27 2010

Keywords

Comments

For k>=1, 2k+4 consecutive primes P1, P2, ..., P2k+4 defining a cluster of twin primes of order k iff P2-P1 <> 2, P4-P3 = P6-P5 = ... = P2k+2 - P2k+1 = 2, P2k+4 - P2k+3 <> 2.
Also the lengths of maximal runs of terms differing by 2 in A029707 (leading index of twin primes), complement A049579. - Gus Wiseman, Dec 05 2024

Examples

			The twin prime cluster ((101,103),(107,109)) of order k=2 stems from the 2k+4 = 8 consecutive primes (89, 97, 101, 103, 107, 109, 113, 127) because 97-89 <> 2, 103-101 = 109-107 = 2, 127-113 <> 2.
From _Gus Wiseman_, Dec 05 2024: (Start)
The leading indices of twin primes are:
  2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, ...
with maximal runs of terms differing by 2:
  {2}, {3,5,7}, {10}, {13}, {17}, {20}, {26,28}, {33,35}, {41,43,45}, {49}, {52}, ...
with lengths a(n).
(End)
		

Crossrefs

Cf. A077800.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A006512 gives the greater of twin primes.
A029707 gives the leading index of twin primes, complement A049579.
A038664 finds the first prime gap of length 2n.
A046933 counts composite numbers between primes.

Programs

  • Maple
    R:= 1: count:= 1: m:= 0:
    q:= 5: state:= 1:
    while count < 100 do
     p:= nextprime(q);
     if state = 1 then
        if p-q = 2 then state:= 2; m:= m+1;
        else
          if m > 0 then R:= R,m; count:= count+1; fi;
          m:= 0
        fi
     else state:= 1;
     fi;
     q:= p
    od:
    R; # Robert Israel, Feb 07 2023
  • Mathematica
    Length/@Split[Select[Range[2,100],Prime[#+1]-Prime[#]==2&],#2==#1+2&] (* Gus Wiseman, Dec 05 2024 *)
  • PARI
    a(n)={my(o,P,L=vector(3));n++;forprime(p=o=3,,L=concat(L[2..3],-o+o=p);L[3]==2||next;L[1]==2&&(P=concat(P,p))&&next;n--||return(#P);P=[p])} \\ M. F. Hasler, May 04 2015

Extensions

More terms from M. F. Hasler, May 04 2015

A274792 a(n) = smallest prime p(1) in a symmetrical constellation of n consecutive twin primes: p(1), p(1)+2, ..., p(n), p(n)+2.

Original entry on oeis.org

3, 5, 5, 663569, 3031329797, 17479880417, 1855418882807417, 2640138520272677
Offset: 1

Views

Author

Natalia Makarova, Jul 07 2016

Keywords

Examples

			The list of two consecutive twin primes (5, 7, 11, 13) is symmetrical because 5+13 = 7+11. Thus a(2) = 5.
The list of three consecutive twin primes (5, 7, 11, 13, 17, 19) is symmetrical because 5+19 = 7+17 = 11+13. Thus a(3) = 5.
		

Crossrefs

Cf. A077800.

Extensions

a(7)-a(8) from Dmitry Petukhov, Jul 07 2016

A097493 Primes which are two greater than A097492 terms.

Original entry on oeis.org

7, 37, 457, 8647, 51315414607
Offset: 1

Views

Author

Cino Hilliard, Aug 24 2004

Keywords

Comments

The next term (17866..79237) has 186 digits.

Examples

			a(4) = 8647 = (Product_{k=1..4} A006512(k)) + 2 = 5*7*13*19 + 2 = A097492(4) + 2. - _Hartmut F. W. Hoft_, Apr 27 2021
		

Crossrefs

Programs

  • Mathematica
    step[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p+2], {{p,p+2}}, {}]], p}]
    largerTwin[n_] := Last[Transpose[First[NestWhile[step, {{{3, 5}}, 3}, Length[First[step[#]]]<=n&]]]]
    a097492[n_] := Rest[FoldList[Times, 1, largerTwin[n]]]
    a097493[n_] := Select[Map[#+2&, a097492[n]], PrimeQ]
    a097493[68] (* Hartmut F. W. Hoft, Apr 27 2021 *)
  • PARI
    fu(n) = p=1;for(x=1,n,p*=twinu(x);if(isprime(p+2),print1(p+2", ")))
    twinu(n) = { local(c,x); c=0; x=1; while(c
    				

Extensions

Edited by Don Reble, Apr 16 2007

A104225 Decimal expansion of -x, where x is the real root of f(x) = 1 + Sum_{n} (twin_prime(n))*x^n.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Apr 01 2005

Keywords

Examples

			-0.665070048764852292...
		

References

  • S. R. Finch, "Kalmar's Composition Constant", Section 5.5 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 292-295, 2003.
  • Martin Gardner, "Patterns in Primes are a Clue to the Strong Law of Small Numbers." Sci. Amer. 243, 18-28, Dec. 1980.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, 1979.

Crossrefs

Programs

  • Mathematica
    ps={}; Do[If[PrimeQ[n]&&PrimeQ[n+2], AppendTo[ps, {n, n+2}]], {n, 3, 40001, 2}];
    ps=Flatten[ps];
    RealDigits[ -x /. FindRoot[0==1+Sum[x^n ps[[n]], {n, 1000}], {x, -0.665}, WorkingPrecision->100]][[1]] (* T. D. Noe *)

Formula

Decimal expansion of -x where x is the real root of f(x) = 1 + 3x + 5x^2 + 5x^3 + 7x^4 + 11x^5 + 13x^6 + 17x^7 + 19x^8 + 29x^9 + 31x^10 + 41x^11 + 43x^12 + 59x^13 + 61x^14 + 71x^15 + 73x^16 + ... where for n>0 the coefficient of x^n is the n-th twin prime.

Extensions

Offset corrected by Sean A. Irvine, May 24 2025
a(99) corrected by Michael De Vlieger, May 24 2025

A129950 Indicator function of twin primes: 1 if n is a twin prime member, 0 if not prime, -1 else (isolated prime or 2).

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

Views

Author

Cino Hilliard, Jun 10 2007

Keywords

Comments

Absolute values are the same as A010051.

Crossrefs

Programs

  • Mathematica
    Array[If[PrimeQ@ #, If[Or[PrimeQ[# - 2], PrimeQ[# + 2]], 1, -1], 0] &, 100] (* Michael De Vlieger, Jan 03 2019 *)
  • PARI
    istwin(n) = local(p1, p2); if(n==5,return(2));if(isprime(n),p1=n-2;p2=n+2; if(isprime(p1),return(1));if(isprime(p2),return(-1));return(0))
    t(x) = if(abs(istwin(x))==1||x==5,1,if(isprime(x),-1,0))
    for(j=1,100,print1(t(j)","))
    
  • PARI
    a(n) = if(isprime(n), (-1)^(!isprime(n-2) && !isprime(n+2)), 0); \\ Typos corrected by Antti Karttunen, Jan 03 2019

Formula

a(n) = 2*A164292(n) - A010051(n). - Antti Karttunen, Jan 03 2019

Extensions

Definition and a(67) corrected by M. F. Hasler, Jan 20 2012

A182482 6*n*A182481(n)-1.

Original entry on oeis.org

5, 11, 17, 71, 29, 71, 41, 191, 107, 59, 197, 71, 311, 419, 179, 191, 101, 107, 227, 239, 881, 659, 137, 431, 149, 311, 809, 2687, 347, 179, 1301, 191, 197, 1019, 419, 431, 1997, 227, 1871, 239, 1229, 2267, 1031, 1319, 269, 827, 281, 1151, 881, 599
Offset: 1

Views

Author

Vladimir Shevelev, May 01 2012

Keywords

Comments

By the construction of A182481, every term is lesser of twin primes.
Every lesser more than 3 of twin primes appears in the sequence.
Number m=(a(n)+1)/6 is the place of the last appearance of a(n); m is multiple of all previous places of the appearance of a(n), if they exist.
In particular, a(n) appears only once, if (a(n)+1)/6 is 1 or prime (in this case n is 1 or prime and A182481(n)=1). Conversely is not true. For example, a(10)=59 appears only once, although 10 is not prime.

Examples

			All places where 71 appears are 4,6,12. "Thus" 12 is multiple of 4 and 6.
Since (101+1)/6=17 is prime, then 101 appears only once.
		

Crossrefs

A253624 Initial members of prime sextuples (p, p+2, p+12, p+14, p+24, p+26).

Original entry on oeis.org

5, 17, 1277, 4217, 21587, 91127, 103967, 113147, 122027, 236867, 342047, 422087, 524957, 560477, 626597, 754967, 797567, 909317, 997097, 1322147, 1493717, 1698857, 1748027, 1762907, 2144477, 2158577, 2228507, 2398157, 2580647, 2615957
Offset: 1

Views

Author

Karl V. Keller, Jr., Jan 06 2015

Keywords

Comments

This sequence is primes p for which there exist three twin prime pairs (p, p+2), (p+12, p+14) and (p+24, p+26).
Excluding 5, this is a subsequence of each of the following: A128468 (a(n)=30n+17). A039949 (Primes of the form 30n-13), A181605 (twin primes ending in 7).
Note that not in all cases (p, p+2, p+12, p+14, p+24, p+26) are consecutive primes; the first p's for which (p, p+2, p+12, p+14, p+24, p+26) are consecutive primes are 4217, 21587, 91127, 103967, 236867, 342047, 422087, 560477, 797567, 909317, 1322147, 1493717, 1748027, 1762907, 2144477, 2158577, 2228507, 2615957 (not in OEIS). - Zak Seidov, May 16 2017

Examples

			For p = 17, the numbers 17, 19, 29, 31, 41, 43 are primes.
		

Crossrefs

Cf. A077800 (twin primes), A128468, A039949, A181605.

Programs

  • Maple
    select(t -> andmap(isprime, [t,t+2,t+12,t+14,t+24,t+26]),
    [5, seq(30*k+17,k=0..10^5)]); # Robert Israel, Jan 07 2015
  • Mathematica
    Select[Prime@ Range[2*10^5], Times @@ Boole@ PrimeQ[# + {2, 12, 14, 24, 26}] == 1 &] (* Michael De Vlieger, May 16 2017 *)
    Select[Prime[Range[200000]],AllTrue[#+{2,12,14,24,26},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 15 2021 *)
  • Python
    from sympy import isprime
    for n in range(1,10000001,2):
      if isprime(n) and isprime(n+2) and isprime(n+12) and isprime(n+14) and isprime(n+24) and isprime(n+26): print(n,end=', ')
    
  • Python
    from sympy import isprime, primerange
    def aupto(limit):
      alst = []
      for p in primerange(2, limit+1):
        if all(map(isprime, [p+2, p+12, p+14, p+24, p+26])): alst.append(p)
      return alst
    print(aupto(3*10**6)) # Michael S. Branicky, May 17 2021
Previous Showing 21-30 of 108 results. Next