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-6 of 6 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

A014090 Numbers that are not the sum of a square and a prime.

Original entry on oeis.org

1, 10, 25, 34, 58, 64, 85, 91, 121, 130, 169, 196, 214, 226, 289, 324, 370, 400, 526, 529, 625, 676, 706, 730, 771, 784, 841, 1024, 1089, 1225, 1255, 1351, 1414, 1444, 1521, 1681, 1849, 1906, 1936, 2116, 2209, 2304, 2500, 2809, 2986, 3136, 3364, 3481, 3600
Offset: 1

Views

Author

Keywords

Comments

Sequence is infinite: if 2n-1 is composite then n^2 is in the sequence. (Proof: If n^2 = x^2 + p with p prime, then p = (n-x)(n+x), so n-x=1 and n+x=p. Hence 2n-1=p is prime, not composite.) - Dean Hickerson, Nov 27 2002
21679 is the last known nonsquare in this sequence. See A020495. - T. D. Noe, Aug 05 2006
A002471(a(n))=0; complement of A014089. - Reinhard Zumkeller, Sep 07 2008
There are no prime numbers in this sequence because at the very least they can be represented as p + 0^2. - Alonso del Arte, May 26 2012
Number of terms <10^k,k=0..8: 1, 8, 27, 75, 223, 719, 2361, 7759, ..., . - Robert G. Wilson v, May 26 2012
So far there are only 21 terms which are not squares and they are the terms of A020495. Those that are squares, their square roots are members of A104275. - Robert G. Wilson v, May 26 2012

Examples

			From _Alonso del Arte_, May 26 2012: (Start)
10 is in the sequence because none of 10 - p_i are square (8, 7, 5, 3) and none of 10 - b^2 are prime (10, 9, 6, 1); i goes from 1 to pi(10) or b goes from 0 to floor(sqrt(10)).
11 is not in the sequence because it can be represented as 3^2 + 2 or 0^2 + 11. (End)
		

Crossrefs

Cf. A064233 (does not allow 0^2).

Programs

  • Mathematica
    t={}; Do[k=0; While[k^2=n, AppendTo[t,n]], {n,25000}]; t (* T. D. Noe, Aug 05 2006 *)
    max = 5000; Complement[Range[max], Flatten[Table[Prime[p] + b^2, {p, PrimePi[max]}, {b, 0, Ceiling[Sqrt[max]]}]]] (* Alonso del Arte, May 26 2012 *)
    fQ[n_] := Block[{j = Sqrt[n], k}, If[ IntegerQ[j] && !PrimeQ[2j - 1], True, k = Floor[j]; While[k > -1 && !PrimeQ[n - k^2], k--]; If[k == -1, True, False]]]; Select[ Range[3600], fQ] (* Robert G. Wilson v, May 26 2012 *)

A143989 Numbers having a unique representation as a sum of a prime and a square.

Original entry on oeis.org

2, 4, 5, 8, 9, 13, 15, 16, 22, 24, 26, 31, 36, 37, 40, 46, 49, 50, 55, 61, 70, 74, 76, 81, 82, 94, 99, 100, 106, 115, 120, 127, 133, 136, 142, 144, 145, 154, 159, 166, 170, 178, 184, 202, 205, 219, 221, 225, 235, 246, 250, 253, 256, 265, 268, 274, 295, 298, 301, 310
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 07 2008

Keywords

Comments

A002471(a(n)) = 1; subsequence of A014089.

A365127 Numbers that are the sum of a prime number and a fourth power of a nonnegative integer.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20, 21, 23, 24, 27, 29, 30, 31, 32, 33, 35, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 53, 54, 57, 59, 60, 61, 62, 63, 67, 68, 69, 71, 72, 73, 74, 75, 77, 79, 80, 83, 84, 86, 87, 88, 89, 90, 92, 94, 95, 97, 98, 99, 100
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 24 2023

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 100; f[x_] := Sum[x^Prime[i], {i, 1, nmax}] Sum[x^j^4, {j, 0, nmax^(1/4)}]; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, nmax}]]

A307646 Numbers that are the sum of a prime number and a nonnegative cube.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 29, 30, 31, 32, 34, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 79, 80, 81, 83, 84, 86, 87, 88, 89, 90, 91
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 19 2019

Keywords

Crossrefs

Formula

Exponents in expansion of (Sum_{i>=1} x^prime(i)) * (Sum_{j>=0} x^(j^3)).

A111908 Numbers that are not the sum of a prime and a nonzero triangular number.

Original entry on oeis.org

1, 2, 7, 36, 61, 105, 171, 210, 211, 216, 325, 351, 406, 528, 561, 630, 741, 780, 990, 1081, 1176, 1275, 1596, 1711, 1830, 1953, 2016, 2145, 2346, 2628, 2775, 3003, 3081, 3240, 3321, 3655, 3741, 3916, 4278, 4371, 4465, 4560, 4851, 5253, 5460, 5565, 5886
Offset: 1

Views

Author

Stefan Steinerberger, Nov 25 2005

Keywords

Comments

Can anybody prove or disprove a(n) = O(n^c) for some constant c?
Jonathan Vos Post has observed that every term in A076768 also occurs in this sequence.

Examples

			7 = 1+6 = 2+5 = 3+4; 7 is in the sequence because there is no sum where the first element is a prime and the second one a triangular number.
		

Crossrefs

Programs

  • Mathematica
    lim=6000;plim=PrimePi[lim];tlim=Ceiling[Sqrt[2lim]];Complement[Range[lim],Union[Flatten[Table[Prime[i]+PolygonalNumber[j],{i,plim},{j,tlim}]]]] (* James C. McMahon, Jun 04 2024 *)

Extensions

a(47) and offset corrected by Donovan Johnson, Feb 09 2013
Showing 1-6 of 6 results.