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

A103514 a(n) is the smallest m such that primorial(n)/2 - 2^m is prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 1, 25, 2, 1, 6, 6, 19, 1, 13, 3, 3, 11, 29, 2, 1, 6, 3, 4, 2, 6, 4, 15, 6, 4, 20, 4, 1, 7, 16, 4, 7, 22, 3, 12, 13, 9, 35, 2, 3, 3, 52, 35, 3, 32, 15, 13, 10, 53, 56, 9, 16, 36, 5, 8, 5, 22, 3, 14, 2, 64, 37, 8, 22, 42, 11, 22, 22, 12, 11, 26, 1, 54, 187, 20, 9
Offset: 2

Views

Author

Lei Zhou, Feb 15 2005

Keywords

Examples

			P(2)/2-2^0=2 is prime, so a(2)=0;
P(10)/2-2^3=3234846607 is Prime, so a(10)=3.
		

Crossrefs

Programs

  • Mathematica
    nmax = 2^8192; npd = 1; n = 2; npd = npd*Prime[n]; While[npd < nmax, tn = 1; tt = 2; cp = npd - tt; While[(cp > 1) && (! (PrimeQ[cp])), tn = tn + 1; tt = tt*2; cp = npd - tt]; If[cp < 2, Print["*"], Print[tn]]; n = n + 1; npd = npd*Prime[n]]
    (* Second program: *)
    k = 1; a = {}; Do[k = k*Prime[n]; m = 1; While[ ! PrimeQ[k - 2^m], m++ ]; Print[m]; AppendTo[a, m], {n, 2, 200}]; a (* Artur Jasinski, Apr 21 2008 *)
  • PARI
    a(n)=my(t=prod(i=2,n,prime(i)),m); while(!isprime(t-2^m),m++); m \\ Charles R Greathouse IV, Apr 28 2015

Extensions

Edited by N. J. A. Sloane, May 16 2008 at the suggestion of R. J. Mathar

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

Original entry on oeis.org

0, 0, 0, 3, 5, 3, 5, 3, 5, 7, 13, 3, 5, 3, 5, 7, 13, 3, 5, 3, 5, 7, 13, 3, 5, 7, 17, 11, 13, 3, 5, 3, 5, 7, 13, 11, 13, 3, 5, 7, 37, 3, 5, 3, 5, 7, 13, 3, 5, 7, 17, 11, 13, 3, 5, 7, 29, 11, 13, 3, 5, 3, 5, 7, 13, 11, 13, 3, 5, 7, 37, 3, 5, 3, 5, 7, 13, 11
Offset: 1

Views

Author

Lei Zhou, Feb 09 2005

Keywords

Examples

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

Crossrefs

a(n)=0 if A103509(n)=0, otherwise A000040(A103509(n)).

Programs

  • Mathematica
    Join[{0,0,0}, Table[m=3; While[! (PrimeQ[m] && (((n-m)/2) > 2) && PrimeQ[(n-m)/2]), m=m+2]; m, {n, 9, 299, 2}]]
  • Scheme
    (define (A103506 n) (let ((ind (A103509 n))) (if (zero? ind) 0 (A000040 ind)))) ;; Antti Karttunen, Jun 19 2007

Extensions

Edited by Antti Karttunen, Jun 19 2007

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 *)

A103507 a(n) = Least i > 1, such that 2n+1 = 2*A000040(i)+A000040(k) for some k>1, 0 if no such i exists.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Feb 09 2005

Keywords

Examples

			For n < 4 there are no such primes, thus a(1)-a(3)=0. For n=4, 2*4+1 = 9 = 2*3+3 and 3=A000040(2), thus a(4)=2. For n=7, 2*7+1 = 15 = 2*5+5 and 5=A000040(3), thus a(7)=3.
		

Crossrefs

a(n) = A049084(A103153(n)), for n >= 4. Can be used to compute A103153 and A103508. Cf. A103509.

Programs

  • Mathematica
    Do[m = 3; While[ ! (PrimeQ[m] && ((n - 2*m) > 2) && PrimeQ[n - 2*m]), m = m + 2]; k = PrimePi[m]; Print[k], {n, 9, 299, 2}]

Extensions

Edited, Scheme-code added and starting offset changed from 0 to 1 by Antti Karttunen, Jun 19 2007

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

A103515 Primes of the form primorial P(k)*2^n-1 with minimal n, n>=0, k>=2.

Original entry on oeis.org

5, 29, 419, 2309, 30029, 1021019, 19399379, 892371479, 51757545839, 821495767572479, 14841476269619, 304250263527209, 54873078184468933509119, 2459559130353965639, 521426535635040715679, 15751252788463309939261439
Offset: 1

Views

Author

Lei Zhou, Feb 15 2005

Keywords

Comments

Conjecture: sequence is defined for all k>=2

Examples

			P(2)*2^0-1=3*2-1=5 is prime, so a(2)=5;
P(4)*2^1-1=7*5*3*2*2-1=419 is prime, so a(4)=419;
		

Crossrefs

Programs

  • Mathematica
    nmax = 2^2048; npd = 2; n = 2; npd = npd*Prime[n]; While[npd < nmax, tt = 1; cp = npd*tt - 1; While[ ! (PrimeQ[cp]), tt = tt*2; cp = npd*tt - 1]; Print[cp]; n = n + 1; npd = npd*Prime[n]]
Showing 1-7 of 7 results.