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.

User: David Stroup

David Stroup's wiki page.

David Stroup has authored 2 sequences.

A096142 Let p(0) = 1, p(k) = k-th prime for k >= 1; write 2n = p(i) + p(j) with i <= j and i minimal; sequence gives i.

Original entry on oeis.org

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

Author

David Stroup, Jul 23 2004

Keywords

Examples

			a(14)=3, because 28=5+23 (3rd and 9th prime) and 28-1, 28-2, 28-3 are not primes.
		

Programs

  • PARI
    a(n) = {tn = 2 * n; ideb = 0; ok = 0; while (! ok, if (ideb == 0, pj = tn -1, pj = tn - prime(ideb)); if (isprime(pj) || (pj == 1), ok = 1, ideb++);); return (ideb);} \\ Michel Marcus, Aug 29 2013

Extensions

Terms corrected by Michel Marcus, Aug 29 2013

A096139 Number of ways to write 2*n as an ordered sum of two numbers which are prime or 1.

Original entry on oeis.org

1, 3, 3, 4, 3, 4, 5, 4, 6, 6, 5, 8, 5, 4, 8, 6, 7, 8, 5, 6, 10, 8, 7, 12, 8, 6, 12, 6, 7, 14, 7, 10, 12, 6, 10, 14, 11, 10, 14, 10, 9, 18, 9, 8, 20, 8, 9, 14, 8, 12, 18, 12, 11, 18, 14, 14, 22, 12, 11, 24, 7, 10, 20, 8, 14, 20, 11, 10, 18, 16, 15, 22, 11, 10, 26, 10, 16, 22, 11, 16, 20, 12
Offset: 1

Author

David Stroup, Jul 23 2004

Keywords

Comments

A001031(n) = floor((a(n)+1)/2); a(n) mod 2 = A010051(n). - Reinhard Zumkeller, Aug 28 2013

Examples

			a(2)=3 because 4=1+3 or 4=2+2 or 4=3+1;
a(3)=3 because 6=1+5 or 6=3+3 or 6=5+1;
a(4)=4 because 8=1+7 or 8=3+5 or 8=5+3 or 8=7+1;
a(5)=3 because 10=3+7 or 10=5+5 or 10=7+3.
		

Crossrefs

Programs

  • Haskell
    a096139 n = sum (map a010051 gs') + fromEnum (1 `elem` gs')
       where gs' = map (2 * n -) $ takeWhile (< 2 * n) a008578_list
    -- Reinhard Zumkeller, Aug 28 2013
    
  • PARI
    { a(n) = local(s(n) = if(n==1,1,isprime(n))); sum(i=1,2*n,s(i)*s(2*n-i)); } \\ Christian Krause, Dec 06 2022

Extensions

Example extended and typo fixed by Reinhard Zumkeller, Aug 28 2013