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

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

A064283 Least number which may be expressed as the sum of a prime number and a nonzero square in exactly n different ways.

Original entry on oeis.org

3, 6, 27, 38, 83, 167, 248, 227, 488, 398, 887, 668, 902, 908, 1238, 2012, 1448, 1748, 1592, 2537, 2672, 3902, 4457, 4703, 3632, 3713, 5843, 6233, 7052, 8333, 5297, 8888, 9602, 9092, 6368, 9908, 13187, 8153, 12473, 8777, 15923, 16463, 14528, 14852, 20807
Offset: 1

Views

Author

Robert G. Wilson v, Sep 24 2001

Keywords

Comments

A064272(a(n)) = n and A064272(m) <> n for m < a(n). - Reinhard Zumkeller, Mar 31 2013

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a064283 = (+ 2) . fromJust . (`elemIndex` a064272_list)
    -- Reinhard Zumkeller, Mar 31 2013

Extensions

More terms from Vladeta Jovovic, Sep 25 2001
More terms from Sean A. Irvine, Jun 25 2023

A365169 Numbers that are not the sum of a prime number and a fourth power of a positive integer.

Original entry on oeis.org

1, 2, 5, 7, 9, 10, 11, 13, 15, 16, 17, 22, 25, 26, 28, 31, 34, 36, 37, 40, 41, 43, 46, 49, 50, 51, 52, 55, 56, 58, 61, 64, 65, 66, 67, 70, 71, 73, 76, 78, 79, 81, 82, 85, 91, 93, 96, 97, 101, 103, 106, 107, 109, 111, 115, 116, 120, 121, 126, 127, 130, 131, 133, 135
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 24 2023

Keywords

Crossrefs

Programs

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

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

A212709 Positive integers not of the form p * c^2 + b^2, with p prime and c and b nonzero integers.

Original entry on oeis.org

1, 2, 5, 10, 25, 58, 130
Offset: 1

Views

Author

Alonso del Arte, May 24 2012

Keywords

Comments

Many numbers can be ruled out from membership in this sequence with the case c = 1, which then corresponds to p + b^2 (see A064233).
If a positive integer is of the form p * c^2 + b^2, then it may potentially have two different factorizations in Z[sqrt(-p)] (assuming that is not a unique factorization domain, of course): the familiar factorization in Z, and (c + b sqrt(-p))(c - b sqrt(-p)).
There are no more terms <= 2*10^9. - Donovan Johnson, May 30 2012

Examples

			Since 24 can be expressed as 5 * 2^2 + 2^2, it is not in the sequence.
No such expression exists for 25, hence it is in the sequence.
Since 26 can be expressed as 17 * 1^2 + 3^2, it is not in the sequence.
		

Programs

  • Mathematica
    max = 10^5; Complement[Range[max], Flatten[Table[Prime[p]a^2 + b^2, {p, PrimePi[max]}, {a, Ceiling[Sqrt[max/2]]}, {b, Ceiling[Sqrt[max]]}]]]
  • PARI
    v=vectorsmall(10^5,i,1);forprime(p=2,#v,for(a=1,sqrtint(#v\p), b=0; while((t=p*a^2+b++^2)<=#v,v[t]=0)));for(i=1,#v,if(v[i], print1(i", "))) \\ Charles R Greathouse IV, May 29 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-7 of 7 results.