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.

A062602 Number of ways of writing n = p+c with p prime and c nonprime (1 or a composite number).

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 2, 1, 4, 3, 3, 3, 4, 2, 6, 3, 5, 4, 6, 3, 8, 3, 7, 4, 9, 5, 9, 4, 8, 7, 9, 4, 11, 3, 11, 9, 10, 6, 12, 5, 11, 8, 12, 7, 14, 5, 13, 7, 15, 9, 15, 6, 14, 10, 16, 9, 16, 5, 15, 13, 16, 8, 18, 6, 18, 15, 17, 9, 19, 8, 18, 12, 19, 11, 21, 7, 21, 14, 20, 13, 22, 7, 21, 14
Offset: 1

Views

Author

Labos Elemer, Jul 04 2001

Keywords

Examples

			n = 22 has floor(n/2) = 11 partitions of form n = a + b; 3 partitions are of prime + prime [3 + 19 = 5 + 17 = 11 + 11], 3 partitions are of prime + nonprime [2 + 20 = 7 + 15 = 13 + 9], 5 partitions are nonprime + nonprime [1 + 21 = 4 + 18 = 6 + 16 = 8 + 14 = 10 + 12]. So a(22) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[Floor[n/2]], (PrimeQ[#] && Not[PrimeQ[n - #]]) || (Not[PrimeQ[#]] && PrimeQ[n - #]) &]], {n, 80}] (* Alonso del Arte, Apr 21 2013 *)
    Table[Length[Select[IntegerPartitions[n,{2}],AnyTrue[#,PrimeQ] && !AllTrue[ #,PrimeQ]&]],{n,90}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 19 2020 *)

Formula

a(n+1) = SUM(A010051(k)*A005171(n-k+1): 1<=k<=n). [From Reinhard Zumkeller, Nov 05 2009]
a(n) + A061358(n) + A062610(n) = A004526(n). - R. J. Mathar, Sep 10 2021