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-10 of 11 results. Next

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 *)

A064272 Number of representations of n as the sum of a prime number and a nonzero square.

Original entry on oeis.org

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

Views

Author

Vladeta Jovovic, Sep 23 2001

Keywords

Comments

a(A064233(n))=0.
A002471(n) - 1 <= a(n) <= A002471(n). [Reinhard Zumkeller, Sep 30 2011]
A224076(n) <= a(A214583(n)+1) for n such that A214583 is defined; a(A064283(n)) = n and a(m) <> n for m < A064283(n). - Reinhard Zumkeller, Mar 31 2013

Examples

			6=2+4=5+1, thus a(6)=2.
		

Crossrefs

Cf. A064233.
Cf. A000290.

Programs

  • Haskell
    a064272 n = sum $
       map (a010051 . (n -)) $ takeWhile (< n) $ tail a000290_list
    -- Reinhard Zumkeller, Jul 23 2013, Sep 30 2011

Formula

a(n) = SUM(A010051(k)*A010052(n-k+1): 1<=k<=n). [From Reinhard Zumkeller, Nov 05 2009]
G.f.: (Sum_{k>=1} x^prime(k))*(Sum_{k>=1} x^(k^2)). - Ilya Gutkovskiy, Feb 05 2017

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

A302354 Expansion of (Sum_{i>=1} x^prime(i))*(Sum_{j>=0} x^(j^3)).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 06 2018

Keywords

Comments

Number of representations of n as the sum of a prime number and a nonnegative cube.

Examples

			a(11) = 2 because 11 = 3 + 2^3 = 11 + 0^3.
		

Crossrefs

Programs

  • Mathematica
    nmax = 120; Rest[CoefficientList[Series[Sum[x^Prime[i], {i, 1, nmax}] Sum[x^j^3, {j, 0, nmax}], {x, 0, nmax}], x]]

Formula

G.f.: (Sum_{i>=1} x^prime(i))*(Sum_{j>=0} x^(j^3)).

A365126 Number of representations of n as the sum of a prime number and a fourth power of a nonnegative integer.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Aug 24 2023

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 120; CoefficientList[Series[Sum[x^Prime[i], {i, 1, nmax}] Sum[x^j^4, {j, 0, nmax^(1/4)}], {x, 0, nmax}], x] // Rest

Formula

G.f.: (Sum_{i>=1} x^prime(i)) * (Sum_{j>=0} x^(j^4)).

A133364 Number of ways of writing n as a sum of a prime and a square-full number.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Oct 26 2007

Keywords

Comments

This is to square-full numbers A001694 as A098983 is to squarefree numbers A005117 and as A002471 is to squares A000290. Asymptotics of this should relate to A098983.

Examples

			a(3) = 1 because 3=2+1 where 2 is prime and 1 is square-full.
a(4) = 1 because 4=3+1 where 3 is prime and 1 is square-full.
a(5) = 0 because there is no positive solution to 5 = prime+(square-full).
a(6) = 2 because 6=5+1=2+4.
a(7) = 1 because 7=3+4.
a(8) = 1 because 8=7+1.
a(9) = 1 because 9=5+4.
a(10) = 1 because 10=2+8.
a(11) = 3 because 11=2+9=3+8=7+4.
a(12) = 2 because 12=3+9=11+1.
a(13) = 1 because 13=5+8.
a(14) = 2 because 14=5+9=13+1.
a(15) = 2 because 15=7+8=11+4.
a(16) = 1 because 16=7+9.
a(17) = 1 because 17=13+4.
a(18) = 2 because 18=2+16=17+1.
a(19) = 2 because 19=3+16=11+8.
a(20) = 2 because 20=19+1=11+9.
		

Crossrefs

Programs

  • Maple
    isA001694 := proc(n) local digs,i ; digs := ifactors(n)[2] ; for i in digs do if op(2,i) = 1 then RETURN(false) ; fi ; od: RETURN(true) ; end: A133364 := proc(n) local a,p ; a := 0 ; p := 2 ; while p < n do if isA001694(n-p) then a := a+1 ; fi ; p := nextprime(p) ; od: RETURN(a) ; end: seq(A133364(n),n=3..90) ; # R. J. Mathar, Nov 09 2007
  • Mathematica
    a = {}; For[n = 3, n < 100, n++, c = 0; For[j = 1, Prime[j] < n, j++, d = 1; b = FactorInteger[n - Prime[j]]; For[m = 1, m < Length[b] + 1, m++, If[b[[m, 2]] < 2, d = 0]]; If[d == 1, c++ ]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Oct 29 2007 *)

Formula

a(n) = Card{n = i + j where i is in A000040 and j is in A001694}.

Extensions

Corrected and extended by Stefan Steinerberger, Oct 29 2007 and by R. J. Mathar, Nov 09 2007

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.

A365288 a(n) is the least positive integer that can be expressed as the sum of a prime number and a square of a nonnegative integer in exactly n ways.

Original entry on oeis.org

1, 2, 3, 11, 38, 107, 83, 167, 293, 227, 398, 677, 668, 902, 908, 1238, 1487, 1448, 1748, 1592, 2273, 2672, 3167, 3947, 4457, 3632, 3713, 6047, 5843, 7052, 8123, 5792, 5297, 9602, 9092, 6368, 9908, 13268, 8153, 9833, 8777, 16112, 15923, 14528, 14852, 18233
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 31 2023

Keywords

Examples

			For n = 3: 11 = 2 + 3^2 = 7 + 2^2 = 11 + 0^2.
		

Crossrefs

A059400 a(n) is the least odd number of the form p + k^2 with p prime and k > 0 which can be represented in exactly n different ways.

Original entry on oeis.org

1, 3, 11, 27, 77, 83, 167, 293, 227, 503, 437, 887, 923, 1007, 1133, 1487, 2243, 2147, 2477, 2273, 2537, 3167, 3947, 4457, 4703, 3737, 3713, 5843, 6233, 8123, 8333, 5297, 11513, 10127, 9407, 10853, 10577, 13187, 8153, 12473, 8777, 15923, 16463, 17513
Offset: 0

Views

Author

Robert G. Wilson v, Mar 15 2001

Keywords

Comments

Note that A002471 allows for k to equal zero.

Examples

			a(3) = 27 because 27 = 23+2^2 = 11+4^2 = 2+5^2 and is the least odd number to exhibit this property of 3 representations.
		

References

  • David Wells, "The Penguin Dictionary of Curious and Interesting Numbers," Revised Edition, Penguin Books, London, 1997, page 63.

Crossrefs

Cf. A002471.

Programs

  • Mathematica
    a = Table[ 0, {55} ]; Do[ c = 0; k = 1; While[ n - k^2 > 1, If[ PrimeQ[ n - k^2], c++ ]; k++ ]; If[ a[[c]] == 0, a[[c]] = n], { n, 1, 30500, 2} ]; a

Extensions

Name clarified by Donovan Johnson, Nov 24 2012

A253238 Number of ways to write n as a sum of a perfect power (>1) and a prime.

Original entry on oeis.org

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

Views

Author

Eric Chen, May 17 2015

Keywords

Comments

In this sequence, "perfect power" does not include 0 or 1, "prime" does not include 1. Both "perfect power" and "prime" must be positive.
In the past, I conjectured that a(n) > 0 for all n>24, but this is not true. My PARI program found that a(1549) = 0.
I also asked which a(n) are 1. For example, 331 is a de Polignac number (A006285), so it cannot be written as 2^n+p with p prime, and 331-6^n must divisible by 5, 331-10^n must divisible by 3, ..., 331-18^2 = 331-324 = 7 is prime (and it is the only prime of the form 331-m^n, with m, n natural numbers, m>1, n>1), so a(331) = 1. Similarly, a(3319) = 1. Conjecture: a(n) > 1 for all n > 3319.
This conjecture is not true: a(1771561) = 0. (See A119748)
Another conjecture: For every number m>=0, there is a number k such that a(n)>=m for all n>=k.
Another conjecture: Except for k=2, first occurrence of k must be earlier then first occurrence of k+1.
For n such that a(n) = 0, see A119748.
For n such that a(n) = 1, see the following a-file of this sequence.

Crossrefs

Programs

  • Mathematica
    nn = 128; pwrs = Flatten[Table[Range[2, Floor[nn^(1/ex)]]^ex, {ex, 2, Floor[Log[2, nn]]}]]; pp = Prime[Range[PrimePi[nn]]]; t = Table[0, {nn}]; Do[ t[[i[[1]]]] = i[[2]], {i, Tally[Sort[Select[Flatten[Outer[Plus, pwrs, pp]], # <= nn &]]]}]; t
  • PARI
    a(n) = sum(k=1, n-1, ispower(k) && isprime(n-k))
    
  • PARI
    a(n)=sum(e=2,log(n)\log(2),sum(b=2,sqrtnint(n,e),isprime(n-b^e)&&!ispower(b))) \\ Charles R Greathouse IV, May 28 2015
Showing 1-10 of 11 results. Next