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

A103151 Number of decompositions of 2n+1 into 2p+q, where p and q are both odd primes (A065091).

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 1, 3, 2, 2, 2, 3, 3, 4, 2, 4, 2, 4, 4, 4, 4, 5, 3, 4, 6, 5, 3, 6, 3, 3, 6, 6, 5, 7, 3, 4, 7, 6, 5, 8, 3, 7, 7, 7, 4, 10, 5, 6, 9, 5, 5, 11, 5, 6, 9, 7, 6, 10, 7, 5, 11, 8, 6, 10, 5, 6, 12, 8, 5, 12, 5, 9, 12, 8, 6, 13, 7, 6, 11, 9, 9, 16, 4, 8, 12, 9, 9, 13, 7, 6, 13, 11, 8, 16, 6
Offset: 1

Views

Author

Lei Zhou, Feb 09 2005

Keywords

Comments

Conjecture: all items for n>=4 are greater than or equal to 1. This is a stronger conjecture than the Goldbach conjecture.

Examples

			For 2*4+1 = 9 we have just one such composition: 9 = 2*3+3, so a(4)=1;
For 2*14+1 = 29 we have four such compositions: 29 = 2*3+23 = 2*5+19 = 2*11+7 = 2*13+3, so a(14)=4.
		

Crossrefs

Programs

  • Maple
    A103151 := proc(n)
        local s,a,q;
        a := 0 ;
        s := 2*n+1 ;
        for pi from 2 do
            q := s-2*ithprime(pi) ;
            if q <=2 then
                return a ;
            else
                if isprime(q) then
                    a := a+1 ;
                end if;
            end if;
        end do:
    end proc: # R. J. Mathar, Feb 22 2014
  • Mathematica
    Do[m = 3; ct = 0; While[(m*2) < n, If[PrimeQ[m], cp = n - (2*m); If[ PrimeQ[cp], ct = ct + 1]]; m = m + 2]; Print[ct], {n, 9, 299, 2}]

Extensions

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

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

A103153 a(n) is the smallest odd prime p such that 2*n+1 = 2*p + A000040(k) for some k>1, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 3, 3, 5, 5, 3, 7, 3, 3, 5, 3, 7, 5, 3, 7, 5, 3, 3, 5, 5, 3, 7, 3, 3, 5, 5, 3, 7, 3, 19, 5, 3, 7, 5, 11, 3, 11, 3, 3, 5, 3, 3, 5, 3, 7, 5, 11, 7, 11, 11, 3, 11, 3, 13, 5, 3, 3, 5, 5, 7, 7, 3, 3, 5, 5, 3, 7, 5, 3, 7, 3, 13, 5, 3, 7, 5, 3, 3, 5, 5, 7, 7, 3
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=7, 2*7+1 = 15 = 2*5+5, thus a(7)=7.
		

Crossrefs

a(n)=0 if A103507(n)=0, otherwise A000040(A103507(n)).
Cf. A195352 (similar definition, but p=2 is allowed).

Programs

  • Mathematica
    Do[m = 3; While[ ! (PrimeQ[m] && ((n - 2*m) > 2) && PrimeQ[n - 2*m]), m = m + 2]; Print[m], {n, 9, 299, 2}]
  • Scheme
    (define (A103153 n) (let ((ind (A103507 n))) (if (zero? ind) 0 (A000040 ind))))

Extensions

Edited and Scheme code added by Antti Karttunen, Jun 19 2007
Definition corrected by Hugo Pfoertner, Sep 16 2011

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
Showing 1-5 of 5 results.