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

A078497 The member r of a triple of primes (p,q,r) in arithmetic progression which sum to 3*prime(n) = A001748(n) = p + q + r.

Original entry on oeis.org

7, 11, 17, 19, 23, 31, 29, 41, 43, 43, 53, 67, 53, 59, 71, 79, 73, 83, 79, 97, 107, 107, 127, 113, 109, 113, 139, 137, 151, 149, 167, 151, 167, 163, 163, 199, 197, 179, 191, 199, 233, 223, 227, 241, 223, 283, 257, 277, 239, 251, 271, 263, 263, 269, 281, 313
Offset: 3

Views

Author

Serhat Sevki Dincer (sevki(AT)ug.bilkent.edu.tr), Nov 27 2002

Keywords

Comments

In case more than one triple of primes p, q=p+d and r=p+2*d exists, we take r=a(n) from the triple with the smallest d. This shows the difference from A092940, which would take the maximum r over all triples. - R. J. Mathar, May 19 2007

Examples

			a(1) = 7 because 3+5+7 = 15;
a(2) = 11 because 3+7+11 = 21;
a(3) = 17 because 5+11+17= 33.
		

Crossrefs

Programs

  • Maple
    A078497 := proc(n) local p3, i,d,r,p; p3 := ithprime(n) ; i := n+1 ; while true do r := ithprime(i) ; d := r-p3 ; p := p3-d ; if isprime(p) then RETURN(r) ; fi ; i := i+1 ; od ; RETURN(-1) ; end: for n from 3 to 60 do printf("%d, ",A078497(n)) ; od ; # R. J. Mathar, May 19 2007
  • Mathematica
    f[n_] := Block[{p = Prime[n], k}, k = p + 1; While[ !PrimeQ[k] || !PrimeQ[2p - k], k++ ]; k]; Table[ f[n], {n, 3, 60}]

Extensions

Edited and extended by Robert G. Wilson v, Nov 29 2002
Further edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar

A092938 a(n) = least prime p such that 2*prime(n) - p is prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 3, 3, 7, 3, 5, 3, 3, 3, 3, 5, 3, 5, 13, 3, 3, 7, 7, 3, 5, 3, 3, 7, 3, 7, 3, 3, 5, 3, 7, 5, 19, 3, 13, 3, 29, 5, 3, 3, 3, 5, 19, 3, 3, 5, 19, 3, 11, 3, 3, 5, 3, 17, 19, 7, 5, 3, 17, 7, 3, 7, 3, 3, 13, 3, 7, 5, 17, 7, 3, 7, 5, 5, 7, 5, 7, 11, 3, 3, 3, 19, 3, 11, 3, 3, 7, 5, 5, 3, 5, 7, 23, 5, 3
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

a(n) = least prime p such that prime(n) = (p+q)/2, where q is also prime.
a(n) <= prime(n). Conjecture: a(n) = prime(n) only for n = 1 and 2.

Examples

			2*prime(8) = 38; 38 - 2 = 36, 38 - 3 = 35, 38 - 5 = 33 are composite, but 38 - 7 = 31 is prime. Hence a(8) = 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local pn,p;
       pn:= ithprime(n);
       p:= 1;
       do
         p:= nextprime(p);
         if isprime(2*pn-p) then return p fi
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 31 2020
  • Mathematica
    a[n_] := Module[{p, q = Prime[n]}, For[p = 2, True, p = NextPrime[p], If[PrimeQ[2q-p], Return[p]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 07 2023 *)
  • PARI
    {for(n=1, 98, k=2*prime(n); p=2; while(!isprime(k-p), p=nextprime(p+1)); print1(p,","))} \\ Klaus Brockhaus, Dec 23 2006

Extensions

Edited and extended by Klaus Brockhaus, Dec 23 2006

A092939 Index of the first occurrence of prime(n) in A092938.

Original entry on oeis.org

1, 2, 10, 8, 52, 18, 57, 36, 96, 40, 110, 249, 154, 328, 123, 288, 495, 125, 826, 343, 546, 431, 670, 833, 694, 1555, 216, 1399, 1195, 1620, 1780, 3843, 2920, 647, 7722, 873, 7492, 4485, 6768, 8201, 7991, 5178, 11744, 2669, 16060, 5809, 11149, 18177, 5307
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

Smallest k such that prime(n) = A092938(k).

Examples

			First occurrence of prime(6) = 13 is A092938(18), so a(6) = 18.
		

Crossrefs

Programs

  • Maple
    # with f as in A092938N:= ithprime(50): V:= Vector(N): count:= 0:
    for n from 1 while count < 50 do
      v:= f(n);
      if v <= N and V[v]=0 then count:= count+1; V[v]:= n;
      fi;
    od:
    seq(V[ithprime(i)],i=1..50); # Robert Israel, Jul 31 2020
  • PARI
    {v=vector(50);for(n=1,20000,k=2*prime(n);j=1;while(!isprime(k-prime(j)),j=j+1);if(j<=z&&v[j]==0,v[j]=n));for(i=1,#v,print1(v[i],","))}

Extensions

Edited and extended by Klaus Brockhaus, Dec 23 2006
Showing 1-3 of 3 results.