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.

A064233 Numbers that are not the sum of a prime number and a nonzero square.

Original entry on oeis.org

1, 2, 5, 10, 13, 25, 31, 34, 37, 58, 61, 64, 85, 91, 121, 127, 130, 169, 196, 214, 226, 289, 324, 370, 379, 400, 439, 526, 529, 571, 625, 676, 706, 730, 771, 784, 829, 841, 991, 1024, 1089, 1225, 1255, 1351, 1414, 1444, 1521, 1549, 1681, 1849, 1906, 1936, 2116
Offset: 1

Views

Author

Axel Harvey, Sep 22 2001

Keywords

Comments

The sequence is infinite, cf. A014090. Subsequence of squares = A053726^2. Subsequence of nonsquares is disjoint union of A020495 and A065377 and so is probably finite. - Vladeta Jovovic, Apr 02 2005

Examples

			5 = 1+4 or 2+3; a prime and a square do not appear together in either sum.
		

Crossrefs

Complement of A058654.

Programs

  • Mathematica
    Complement[ Table[ n, {n, 1, 10000} ], Union[ Flatten[ Table[ Prime[ i ] + j^2, {i, 1, 1230}, {j, 1, 100} ] ] ] ]
    nspQ[n_]:=Length[Select[IntegerPartitions[n,{2}],(PrimeQ[#[[1]]] && IntegerQ[ Sqrt[ #[[2]]]])||(PrimeQ[#[[2]]]&&IntegerQ[Sqrt[#[[1]]]])&]] == 0; Select[ Range[ 2200],nspQ] (* Harvey P. Dale, Jun 18 2021 *)
  • PARI
    list(lim)=my(v=vectorsmall(lim\1,i,1),u=List(),b);forprime(p=2,#v, b=0; while((t=p+b++^2)<=#v,v[t]=0));for(i=1,#v,if(v[i],listput(u,i))); Vec(u) \\ Charles R Greathouse IV, May 29 2012

Extensions

More terms from Vladeta Jovovic, Robert G. Wilson v and Felice Russo, Sep 23 2001

A065397 Primes which have no representation p + k*(k+1) / 2, with p prime and k > 0: A000040-Complement of A065396.

Original entry on oeis.org

2, 7, 61, 211
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 05 2001

Keywords

Comments

Finite? (Checked up to A000040(100000) = 1299709.)
Next term > 7000000. - R. J. Mathar, Apr 23 2006
No other terms less than 2*10^9. - T. D. Noe, Mar 26 2008

Crossrefs

Programs

  • Maple
    for n from 1 to 7000000 do if isprime(n) = true then foundp := false ; for k from 1 to n do if isprime(n-k*(k+1)/2) = true then foundp := true ; break ; elif n-k*(k+1)/2 < 2 then break ; fi ; od ; if foundp = false then print(n) ; fi ; fi ; od : # R. J. Mathar, Apr 23 2006

A065376 Primes of the form p + k^2, p prime and k > 0.

Original entry on oeis.org

3, 7, 11, 17, 19, 23, 29, 41, 43, 47, 53, 59, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 03 2001

Keywords

Comments

Conjectured to contain all primes > 7549. - Robert Israel, Sep 03 2014

Examples

			a(3) = 11 = 2 + 3^2 = 7 + 2^2.
		

Crossrefs

Complement of A065377.

Programs

  • Maple
    N = 1000: # to get all entries <= N
    Primes:= select(isprime, {$1..N}):
    Primes intersect {seq(seq(p + k^2, p = Primes),k=1..floor(sqrt(N)))}; # Robert Israel, Sep 03 2014
  • Mathematica
    q[n_] := AnyTrue[Range[Floor[Sqrt[n]]], PrimeQ[n - #^2] &]; seq[lim_] := Module[{p = Prime[Range[lim]]}, Select[p, q]]; seq[100] (* Amiram Eldar, Apr 12 2025 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, forprime(q=2, p-1, if (issquare(p-q), print1(p, ", "); break;);););} \\ Michel Marcus, Sep 03 2014

A073770 Primes p not of the form q + s where q is prime and s > 0 is the smallest square such that q + s is prime.

Original entry on oeis.org

2, 5, 13, 19, 29, 31, 37, 43, 61, 67, 73, 79, 103, 109, 127, 139, 151, 157, 163, 179, 181, 191, 193, 199, 211, 223, 229, 241, 271, 277, 283, 313, 331, 337, 349, 359, 367, 373, 379, 397, 409, 421, 431, 433, 439, 463, 487, 499, 521, 523, 541, 547, 569, 571, 577
Offset: 1

Views

Author

Klaus Brockhaus, Aug 08 2002

Keywords

Comments

A065377 is a subsequence of this sequence. Except for the initial term 2 this sequence is disjoint to A073609.

Examples

			13 cannot be partitioned into a prime and a square > 0, so 13 is a term. The only partition of 19 into a prime and a square > 0 is (3,16), but 16 is not the smallest square s such that 3 + s is prime since 3 + 4 = 7 is also prime; therefore 19 is a term.
		

Crossrefs

A157495 The smallest prime difference between prime(n) and any smaller square.

Original entry on oeis.org

2, 2, 5, 3, 2, 13, 13, 3, 7, 13, 31, 37, 5, 7, 11, 17, 23, 61, 3, 7, 37, 43, 2, 53, 61, 37, 3, 7, 73, 13, 127, 31, 37, 103, 5, 7, 13, 19, 23, 29, 79, 37, 47, 157, 53, 3, 67, 79, 2, 193, 37, 43, 97, 107, 61, 7, 13, 127, 241, 137, 139, 37, 163, 167, 277, 61, 7, 13, 23, 313, 29, 103
Offset: 1

Views

Author

Cino Hilliard, Mar 01 2009

Keywords

Comments

If the only preceding square k such that p-k^2 is prime is 0, then we generate sequence A065377.

Examples

			The 7th prime is 17. The preceding squares of 17 are 16,9,4,1,0. The differences are 17-16=1, 17-9=8, 17-4=13, 17-1=16 and 17-0=17. Then 4 is the first preceding square of 17 that can be subtracted from 17 to get a prime. So a(7)=13. If we reduce the prime(6)=13 in this fashion, we have 13-9=4, 13-1=12, 13-0=13. This shows that 0 is the first square that can be subtract from 13 to get a prime number. So a(6)=13.
		

Crossrefs

Cf. A065377.

Programs

  • Maple
    A157495 := proc(n)
        local p,s ;
        p := ithprime(n) ;
        s := floor(sqrt(p)) ;
        while not isprime(p-s^2) do
            s := s-1;
        end do;
        p-s^2 ;
    end proc:
    seq(A157495(n),n=1..130) ; # R. J. Mathar, Sep 07 2016
  • Mathematica
    Table[SelectFirst[Reverse[p-Range[0,Floor[Sqrt[p]]]^2],PrimeQ],{p, Prime[ Range[80]]}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 23 2017 *)
  • PARI
    g(n)= c=0; forprime(x=2,n,for(k=1,n^2,if(issquare(abs(x-k)) && isprime(k), print1(k","); c++; break))); c

Extensions

NAME rephrased for clarity. - R. J. Mathar, Sep 08 2016

A216684 Primes p such that p - phi(k)^2 is not prime for 1 <= phi(k)^2 < p.

Original entry on oeis.org

2, 5, 13, 31, 37, 61, 127, 379, 439, 571, 619, 739, 829, 991, 1549, 3109, 3301, 3319, 5749, 7549, 7879, 48799
Offset: 1

Views

Author

Michel Lagneau, Sep 15 2012

Keywords

Comments

phi is the Euler totient function phi(n) : A000010.
A065377 is included in this sequence, and that one is probably finite.
No more terms < 10^7. - Robert Israel, Nov 15 2015

Examples

			31 is in the sequence because :
31 - phi(1)^2 = 31 - 1^2 = 30 is composite;
31 - phi(2)^2 = 31 - 1^2 = 30 is composite;
31 - phi(3)^2 = 31 - 2^2 = 27  is composite;
31 - phi(4)^2 = 31 - 2^2 = 27  is composite;
31 - phi(5)^2 = 31 - 4^2 = 15 is composite;
31 - phi(6)^2 = 31 - 2^2 = 27 is the last composite because  phi(7)^2 = 6^2 > 31.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 10000 do:ii:=0:p:=ithprime(n):for k from 1 to p while(p-phi(k)^2>0) do: if type(p- phi(k)^2,prime) =true then ii:=1:else fi:od:if ii=0 then printf(`%d, `,p):else fi:od:

A308516 Odd numbers which are not squares and cannot be written as a sum of a prime and a square.

Original entry on oeis.org

85, 91, 771, 1255, 1351, 21679
Offset: 1

Views

Author

Daniel Starodubtsev, Jun 03 2019

Keywords

Comments

The sequence is probably finite. a(7) > 2000000 (if it exists).
a(7) > 1.5*10^11, if it exists. - Giovanni Resta, Jul 16 2019

Crossrefs

A subsequence of A020495.
Showing 1-7 of 7 results.