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

A195352 Smallest prime p such that 2*n+1 = 2*p + q for some odd prime q.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 7, 2, 2, 3, 5, 2, 3, 2, 2, 3, 2, 3, 7, 2, 3, 7, 2, 2, 3, 5, 2, 3, 2, 2, 3, 5, 2, 3, 2, 3, 19, 2, 3, 7, 5, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 7, 5, 11, 7, 11, 2, 3, 2, 3, 13, 2, 2, 3, 5, 5, 7, 2, 2, 3, 5, 2, 3, 7, 2, 3, 2, 3, 13
Offset: 3

Views

Author

Hugo Pfoertner, Sep 16 2011

Keywords

Comments

Related to Lemoine's conjecture, which states that all odd integers > 5 can be represented as 2*p+q, p, q primes.

Examples

			a(3)=2 because 2*3+1=7=2*2+3; a(4)=2: 2*3+1=9=2*2+5; a(5)=2: 11=2*2+7; a(6)=3: 13=2*3+7.
		

References

Crossrefs

Cf. A002091, A103506 (smallest q), A046927, A195353 (positions of records), A195354 (records), A103153 (prime p=2 excluded), A185091.

Programs

  • Mathematica
    spp[n_]:=Module[{p=2},While[CompositeQ[(2n+1)-2p],p=NextPrime[p]];p]; Array[ spp,90,3] (* Harvey P. Dale, Jun 02 2022 *)

A103509 a(n) is the least j such that 2n+1 = 2*A000040(k) + A000040(j) for some k > 1, or 0 if no such j exists.

Original entry on oeis.org

0, 0, 0, 2, 3, 2, 3, 2, 3, 4, 6, 2, 3, 2, 3, 4, 6, 2, 3, 2, 3, 4, 6, 2, 3, 4, 7, 5, 6, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 12, 2, 3, 2, 3, 4, 6, 2, 3, 4, 7, 5, 6, 2, 3, 4, 10, 5, 6, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 12, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 18, 2, 3, 4, 7, 5, 6, 2, 3, 4, 10, 5, 6, 15, 7, 2, 3, 4, 12, 2, 3, 2, 3
Offset: 1

Views

Author

Lei Zhou, Feb 10 2005

Keywords

Examples

			For n < 4 there are no such primes, thus a(1)=a(2)=a(3)=0.
For n=4, 2*4+1 = 9 = 2*3+3 and 3=A000040(2), thus a(4)=2.
For n=11, 2*11+1 = 23 = 13+2*5 and 13=A000040(6), thus a(11)=6.
		

Crossrefs

Can be used to compute A103506 and A103510. Cf. A103507.

Programs

  • Mathematica
    Do[m = 3; While[ ! (PrimeQ[m] && (((n - m)/2) > 2) && PrimeQ[(n - m)/2]), m = m + 2]; k = PrimePi[m]; Print[k], {n, 9, 299, 2}]
  • PARI
    A103509(n) = if(n<=3,0,my(o=n+n+1); for(i=2,oo, if(isprime((o-prime(i))/2),return(i)))); \\ Antti Karttunen, Mar 30 2021

Formula

a(n) = A049084(A103506(n)), for n >= 4.

Extensions

Edited by Antti Karttunen, Jun 19 2007

A219604 Smallest prime p such that 2n+1 = 4q + p for some odd prime q, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 0, 3, 5, 3, 5, 7, 13, 3, 5, 7, 17, 3, 5, 7, 17, 11, 13, 23, 17, 3, 5, 7, 41, 3, 5, 7, 17, 11, 13, 23, 17, 3, 5, 7, 0, 3, 5, 7, 17, 11, 13, 23, 17, 3, 5, 7, 73, 11, 13, 31, 17, 19, 37, 23, 41, 3, 5, 7, 73, 3, 5, 7, 17, 11, 13, 23, 17, 19, 29, 23, 73, 3
Offset: 1

Views

Author

Michel Lagneau, Apr 12 2013

Keywords

Comments

a(38) = 0.
Conjecture: except m = 77, all odd numbers > 9 are of the form m = p + 4*q where p and q are prime numbers.

Crossrefs

Programs

  • Maple
    for n from 11 by 2 to 200 do:jj:=0:for j from 1 to 1000 while (jj=0) do:p:=ithprime(j):q:=(n-p)/4:if q> 0 and type(q,prime)=true  then jj:=1:printf(`%d, `,p):else fi:od:if jj=0 then printf(`%d, `,0):else fi:od:
  • Mathematica
    Table[m=3;While[!(PrimeQ[m]&&(((2*n+1-m)/4)>1)&&PrimeQ[(2*n+1-m)/4]),m=m+2];Print[n," ",m],{n,5,200}]

A223174 Smallest prime p such that 2n+1 = p + 8*q for some odd prime q, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 7, 0, 3, 5, 7, 17, 11, 13, 23, 17, 3, 5, 7, 0, 11, 13, 31, 17, 3, 5, 7, 41, 11, 13, 31, 17, 19, 37, 23, 41, 43, 29, 31, 73, 3, 5, 7, 41, 11, 13, 47, 17, 3, 5, 7, 73, 11, 13, 31, 17, 19, 37, 23, 41, 43, 29, 31, 97, 3, 5, 7, 41
Offset: 0

Views

Author

Michel Lagneau, May 09 2013

Keywords

Comments

For n > 8, a(12) = a(24) = 0.
The corresponding q = 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 3, 3, 3, 2, 3, 3, 2, 3, 5, 5, 5, 0, 5, 5, 3, 5, 7, 7, 7,... are not always the minimum values. The smallest primes q are in A223175.
Conjecture: except m = 25 and 49, all odd numbers > 17 are of the form m = p + 8*q where p and q are prime numbers.

Examples

			a(14) = 5 because, for p=5 the corresponding q=3 and 5+8*3 = 29 is prime.
		

Crossrefs

Programs

  • Maple
    for n from 1 by 2 to 200 do:jj:=0:for j from 1 to 1000 while (jj=0) do:p:=ithprime(j):q:=(n-p)/8:if q> 0 and type(q,prime)=true  then jj:=1:printf(`%d, `,p):else fi:od:if jj=0 then printf(`%d, `,0):else fi:od:

A223175 Smallest prime q such that 2n+1 = p + 8*q for some odd prime p, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 2, 2, 3, 2, 2, 3, 2, 3, 3, 2, 2, 0, 5, 2, 3, 2, 2, 3, 2, 3, 3, 2, 3, 7, 2, 2, 7, 5, 2, 3, 2, 2, 3, 5, 2, 3, 2, 5, 3, 2, 3, 7, 5, 2, 7, 2, 2, 3, 2, 2, 3, 2, 3, 3, 7, 3, 7, 5, 2, 7, 2, 5, 3, 2, 2, 7, 7, 3, 3, 2, 2, 7, 5, 2
Offset: 0

Views

Author

Michel Lagneau, May 09 2013

Keywords

Comments

For n > 8, a(12) = a(24) = 0.
The corresponding p: 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 7, 0, 11, 13, 7, 17, 19, 13, 23, 17, 19, 29, 31, 0, 11,... are not always the minimum values. The smallest primes p are in A223174.
Conjecture: except m = 25 and 49, all odd numbers > 17 are of the form m = p + 8*q where p and q are prime numbers.

Examples

			a(14) = 2 because, for q=2 the corresponding p=13 and 13+8*2 = 29 is prime.
		

Crossrefs

Programs

  • Maple
    for n from 1 by 2 to 200 do:jj:=0:for j from 1 to 1000 while (jj=0) do:q:=ithprime(j):p:=n-8*q:if p> 0 and type(p, prime)=true  then jj:=1:printf(`%d, `, q):else fi:od:if jj=0 then printf(`%d, `, 0):else fi:od:

A103508 a(n) = 1 + 2 * least i such that A103507(i)=n+1, 0 if no such i exists.

Original entry on oeis.org

9, 15, 31, 101, 139, 227, 91, 503, 995, 451, 751, 539, 1819, 1397, 2957, 3461, 1831, 1417, 6023, 3769, 1777, 9587, 5411, 9421, 18653, 8089, 4511, 6541, 10529, 16051, 19049, 13163, 3139, 22937, 23929, 43363, 24919, 43571, 97367, 55571, 14419, 75209
Offset: 1

Views

Author

Lei Zhou, Feb 10 2005

Keywords

Crossrefs

Programs

  • Scheme
    (define (A103508 n) (+ 1 (* 2 (first-n-where-fun_n-is-i1 A103507 (+ 1 n)))))
    (define (first-n-where-fun_n-is-i1 fun i) (let loop ((n 1)) (cond ((= i (fun n)) n) (else (loop (+ n 1))))))

Extensions

Edited and Scheme-code added by Antti Karttunen, Jun 19 2007

A103510 a(n) = 1 + 2 * least i such that A103509(i)=n+1, 0 if no such i exists.

Original entry on oeis.org

9, 11, 21, 57, 23, 55, 245, 241, 115, 833, 83, 523, 437, 193, 447, 733, 167, 689, 1417, 611, 2297, 1081, 2731, 1283, 2755, 5057, 2761, 887, 2719, 9221, 4909, 8179, 4397, 13891, 9557, 2351, 9257, 5869, 10627, 11941, 1487, 2797, 3947, 5899, 11237, 20069
Offset: 1

Views

Author

Lei Zhou, Feb 10 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Array[a, 500]; Do[a[n] = 0, {n, 1, 500}]; n = 9; ct = 0; While[ct < 150, m = 3; While[ ! (PrimeQ[m] && (((n - m)/2) > 2) && PrimeQ[(n - m)/2]), m = m + 2]; k = PrimePi[m]; If[a[k] == 0, a[k] = n; ct = ct + 1]; n = n + 2]; Print[a]
  • Scheme
    (define (A103510 n) (+ 1 (* 2 (first-n-where-fun_n-is-i1 A103509 (+ 1 n)))))
    (define (first-n-where-fun_n-is-i1 fun i) (let loop ((n 1)) (cond ((= i (fun n)) n) (else (loop (+ n 1))))))

Extensions

Edited and Scheme-code added by Antti Karttunen, Jun 19 2007

A302564 a(n) is the greatest prime p such that (2*n+1-p)/2 is prime.

Original entry on oeis.org

3, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 17, 29, 31, 31, 29, 37, 37, 41, 43, 43, 47, 47, 41, 53, 53, 47, 59, 61, 61, 59, 67, 67, 71, 73, 73, 71, 79, 79, 83, 83, 53, 89, 89, 83, 89, 97, 97, 101, 103, 103, 107, 109, 109, 113, 113, 107, 113, 103, 113, 107, 127, 127, 131, 131, 113, 137, 139, 139
Offset: 3

Views

Author

Robert Israel, Aug 15 2018

Keywords

Comments

Lemoine's conjecture, also called Levy's conjecture, says a(n) exists for all n >= 3.

Crossrefs

Programs

  • Maple
    Lemoine:= proc(x) local s;
    s:= x;
    while s > 3 do
      s:= prevprime(s);
      if isprime((x-s)/2) then return s fi
    od;
    end proc:
    seq(Lemoine(2*n+1),n=3..100);
  • PARI
    a(n) = {my(p = precprime(2*n+1)); while (!isprime((2*n+1-p)/2), p = precprime(p-1)); p;} \\ Michel Marcus, Aug 16 2018
Showing 1-8 of 8 results.