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

A002471 Number of partitions of n into a prime and a square.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A014090(n))=0; a(A014089(n))>0; a(A143989(n))=1. - Reinhard Zumkeller, Sep 07 2008

References

  • Selmer, Ernst S.; Eine numerische Untersuchung ueber die Darstellung der natuerlichen Zahlen als Summe einer Primzahl und einer Quadratzahl. Arch. Math. Naturvid. 47, (1943). no. 2, 21-39.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a002471 n = sum $ map (a010051 . (n -)) $ takeWhile (< n) a000290_list
    -- Reinhard Zumkeller, Jul 23 2013, Sep 30 2011
    
  • Maple
    n->nops(select(isprime,[ seq(n-i^2,i=0..trunc(sqrt(n))) ])):
    with(combstruct): specM0073 := {N=Prod(P, S),P=Set(Z,card>=1), S=Set(Z,card>=0)}: `combstruct/compile`(specM0073,unlabeled): `combstruct/Count`[ specM0073,unlabeled ][ P ] := proc(p) option remember; if isprime(p) then 1 else 0 fi end: `combstruct/Count`[ specM0073,unlabeled ][ S ] := proc(p) option remember; if type(sqrt(p), integer) then 1 else 0 fi end: M0073 := n->count([ N,specM0073,unlabeled ],size=n):
  • Mathematica
    a[n_] := Count[p /. {ToRules[ Reduce[ p > 1 && q >= 0 && n == p + q^2, {p, q}, Integers]]}, _?PrimeQ]; Table[ a[n], {n, 1, 81}] (* from Jean-François Alcover, Sep 30 2011 *)
  • PARI
    a(n)=if(n>1, sum(k=0,sqrtint(n-2), isprime(n-k^2)), 0) \\ Charles R Greathouse IV, Feb 08 2017

Formula

G.f.: (Sum_{i>=0} x^(i^2))*(Sum_{j>=1} x^prime(j)). - Ilya Gutkovskiy, Feb 07 2017

Extensions

Sequence corrected by Paul Zimmermann, Mar 15 1996

A014089 Sum of a square and a prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62
Offset: 1

Views

Author

Keywords

Comments

A002471(a(n))>0; complement of A014090; A143989 is a subsequence. [From Reinhard Zumkeller, Sep 07 2008]

Crossrefs

Cf. A058654.

Programs

  • PARI
    isok(n) = for (i = 0, sqrtint(n), if (isprime(n - i^2), return (1))); 0 \\ Michel Marcus, Sep 04 2013
Showing 1-2 of 2 results.