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 17 results. Next

A219864 Number of ways to write n as p+q with p and 2pq+1 both prime.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 0, 2, 4, 2, 2, 4, 1, 2, 6, 3, 1, 2, 2, 5, 3, 1, 1, 7, 2, 6, 3, 1, 6, 8, 2, 2, 5, 3, 3, 8, 2, 4, 6, 3, 4, 4, 1, 3, 7, 2, 3, 7, 3, 6, 8, 2, 1, 12, 5, 4, 7, 4, 7, 7, 7, 5, 4, 4, 6, 9, 2, 2, 13, 2, 5, 7, 2, 4, 18, 6, 3, 5, 6, 5, 8, 4, 2, 9, 4, 10, 5, 2, 5, 17, 3, 3, 7, 7, 5, 8, 3, 3, 17, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 30 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>7.
This has been verified for n up to 3*10^8.
Zhi-Wei Sun also made the following general conjecture: For each odd integer m not congruent to 5 modulo 6, any sufficiently large integer n can be written as p+q with p and 2*p*q+m both prime.
For example, when m = 3, -3, 7, 9, -9, -11, 13, 15, it suffices to require that n is greater than 1, 29, 16, 224, 29, 5, 10, 52 respectively.
Sun also guessed that any integer n>4190 can be written as p+q with p, 2*p*q+1, 2*p*q+7 all prime, and any even number n>1558 can be written as p+q with p, q, 2*p*q+3 all prime. He has some other similar observations.

Examples

			a(10)=2 since 10=3+7=7+3 with 2*3*7+1=43 prime.
a(263)=1 since 83 is the only prime p with 2p(263-p)+1 prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[2Prime[k](n-Prime[k])+1]==True,1,0],{k,1,PrimePi[n]}]
    Do[Print[n," ",a[n]],{n,1,1000}]

A209254 Number of ways to write 2n-1 = p+q with q practical, p and p^4+q^4 both prime.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 1, 2, 2, 3, 2, 4, 3, 1, 3, 1, 1, 4, 2, 5, 5, 1, 4, 1, 2, 4, 3, 1, 6, 3, 4, 4, 5, 1, 6, 7, 2, 4, 3, 4, 2, 4, 5, 1, 2, 3, 7, 5, 2, 4, 8, 4, 6, 5, 1, 2, 2, 3, 8, 3, 1, 5, 6, 2, 4, 7, 4, 8, 4, 2, 7, 6, 3, 4, 3, 1, 6, 6, 1, 7, 6, 2, 8, 9, 5, 7, 3, 3, 10, 7, 3, 9, 14, 1, 9, 4, 3, 4, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 14 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>1.
Zhi-Wei Sun also conjectured that any odd integer greater than one can be written as p+q with q practical, and p and p^2+q^2 both prime. This is a refinement of Ming-Zhi Zhang's problem related to A036468.

Examples

			a(8)=1 since 2*8-1=11+4 with 4 practical, 11 and 11^4+4^4=14897 both prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_,i_]:=Pow[n,i]=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n],s+1],1]<=DivisorSigma[1,Product[Pow[n,i],{i,1,s}]]+1,0,1],{s,1,Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[pr[2n-1-Prime[k]]==True&&PrimeQ[Prime[k]^4+(2n-1-Prime[k])^4]==True,1,0],{k,1,PrimePi[2n-1]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A232174 Number of ways to write n = x + y (x, y > 0) with x + n*y and x^2 + n*y^2 both prime.

Original entry on oeis.org

0, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 5, 1, 4, 3, 2, 2, 1, 1, 2, 5, 4, 1, 7, 2, 4, 4, 6, 2, 5, 1, 4, 3, 5, 2, 8, 2, 6, 3, 3, 3, 5, 2, 5, 4, 7, 5, 7, 3, 5, 3, 3, 1, 11, 4, 7, 6, 5, 2, 4, 3, 8, 5, 6, 1, 14, 1, 6, 7, 6, 6, 8, 3, 6, 7, 7, 5, 9, 3, 3, 5, 7, 7, 15, 5, 6, 5, 2, 5, 15, 6, 12, 8, 7, 3, 15, 8, 10, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 19 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. Also, a(n) = 1 only for n = 2, 5, 8, 14, 19, 20, 24, 32, 54, 68, 101, 168.
(ii) Every n = 3, 4, ... can be written as x + y (x, y > 0) with x*n + y and x*n - y both prime.
(iii) Any integer n > 2 can be written as P + q (q > 0) with p and p + n*q both prime. Also, any integer n > 7 can be written as p + q (q > 0) with p and n*q - p both prime.
In a paper published in 2017, the author announced a USD $200 prize for the first solution to his conjecture that a(n) > 0 for all n > 1. - Zhi-Wei Sun, Dec 03 2017

Examples

			a(2) = 1 since 2 = 1 + 1 with 1 + 2*1 = 1^2 + 2*1^2 = 3 prime.
a(5) = 1 since 5 = 3 + 2 with 3 + 5*2 = 13 and 3^2 + 5*2^2 = 29 both prime.
a(8) = 1 since 8 = 5 + 3 with 5 + 8*3 = 29 and 5^2 + 8*3^2 = 97 both prime.
a(14) = 1 since 14 = 9 + 5 with 9 + 14*5 = 79 and 9^2 + 14*5^2 = 431 both prime.
a(19) = 1 since 19 = 13 + 6 with 13 + 19*6 = 127 and 13^2 + 19*6^2 = 853 both prime.
a(20) = 1 since 20 = 11 + 9 with 11 + 20*9 = 191 and 11^2 + 20*9^2 = 1741 both prime.
a(24) = 1 since 24 = 5 + 19 with 5 + 24*19 = 461 and 5^2 + 24*19^2 = 8689 both prime.
a(32) = 1 since 32 = 23 + 9 with 23 + 32*9 = 311 and 23^2 + 32*9^2 = 3121 both prime.
a(54) = 1 since 54 = 35 + 19 with 35 + 54*19 = 1061 and 35^2 + 54*19^2 = 20719 both prime.
a(68) = 1 since 68 = 45 + 23 with 45 + 68*23 = 1609 and 45^2 + 68*23^2 = 37997 both prime.
a(101) = 1 since 101 = 98 + 3 with 98 + 101*3 = 401 and 98^2 + 101*3^2 = 10513 both prime.
a(168) = 1 since 168 = 125 + 43 with 125 + 168*43 = 7349 and 125^2 + 168*43^2 = 326257 both prime.
		

References

  • D. A. Cox, Primes of the Form x^2 + n*y^2, John Wiley & Sons, 1989.

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[k+n(n-k)]&&PrimeQ[k^2+n(n-k)^2],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A227908 Number of ways to write 2*n = p + q with p, q and (p-1)^2 + q^2 all prime.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 2, 3, 2, 2, 0, 2, 6, 1, 3, 5, 2, 3, 2, 1, 2, 2, 5, 4, 3, 2, 3, 8, 1, 4, 3, 3, 2, 5, 1, 2, 4, 5, 3, 4, 4, 2, 6, 1, 4, 5, 3, 3, 6, 2, 6, 5, 4, 5, 7, 3, 1, 9, 2, 3, 6, 1, 2, 5, 4, 7, 2, 7, 6, 6, 2, 4, 10, 3, 3, 6, 1, 7, 9, 5, 4, 5, 4, 3, 5, 3, 5, 8, 4, 4, 5, 2, 11, 9, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 12 2013

Keywords

Comments

Conjecture: a(n) > 0 except for n = 1, 16, 292.
This implies not only Goldbach's conjecture for even numbers, but also Ming-Zhi Zhang's conjecture (cf. A036468) that any odd number greater than one can be written as x + y (x, y > 0) with x^2 + y^2 prime.
We have verified the conjecture for n up to 10^7.
Conjecture verified for n up tp 10^9. - Mauro Fiorentini, Sep 21 2023

Examples

			a(7) = 1 since 2*7 = 11 + 3, and (11-1)^2 + 3^2 = 109 is prime.
a(19) = 1 since 2*19 = 7 + 31, and (7-1)^2 + 31^2 = 997 is prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[2n-Prime[i]]&&PrimeQ[(Prime[i]-1)^2+(2n-Prime[i])^2],1,0],{i,1,PrimePi[2n-2]}]
    Table[a[n],{n,1,100}]

A069004 Number of times n^2 + s^2 is prime for positive integers s < n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 3, 1, 4, 2, 1, 4, 3, 3, 3, 4, 3, 4, 6, 2, 4, 5, 3, 7, 6, 4, 4, 4, 4, 7, 6, 5, 6, 8, 5, 6, 7, 3, 9, 5, 5, 8, 8, 7, 9, 6, 7, 10, 8, 6, 9, 10, 5, 8, 8, 6, 10, 11, 8, 11, 10, 6, 9, 15, 5, 10, 11, 4, 11, 13, 6, 12, 10, 12, 11, 9, 8, 11, 19, 10, 15, 9, 8, 19, 11, 8, 11, 14, 15, 13
Offset: 1

Views

Author

T. D. Noe, Apr 02 2002

Keywords

Comments

Conjecture: a(n)>0 for all n>1. - Entries checked by Franklin T. Adams-Watters, May 05 2006
The graph of this sequence inspires the following conjecture: A > a(n)/pi(n) > B, where A and B are constants and pi(n) is the prime counting function (A000720). - T. D. Noe, Feb 26 2007
Stronger conjecture: Let pi(n) be the prime counting function (A000720). Then pi(n) >= a(n) >= pi(n)/5 for n>1, with the following equalities: pi(2)=a(2), pi(10)=a(10) and a(12)=pi(12)/5. - T. D. Noe, Feb 26 2007
Records in a(n) are for n = 1, 2, 5, 8, 10, 20, 25, 35, 40, 49, 59, 65, 80, 115, 125, 130, 158, 200, 250, 265, 310, ... - Thomas Ordowski, Mar 05 2017
Number of primes p = (x^2 + y^2)/2 with 0 < x < y such that x + y = 2n. - Thomas Ordowski, Mar 06 2017

Examples

			a(5)=2 because there are 2 values of s (2 and 4) such that 5^2 + s^2 is a prime number.
		

Crossrefs

Programs

  • Mathematica
    maxN=100; lst={}; For[n=1, n<=maxN, n++, cnt=0; For[d=1, d?PrimeQ],{n,100}] (* _Harvey P. Dale, Mar 01 2023 *)
  • PARI
    a(n) = sum(s=1, n-1, isprime(n^2+s^2)); \\ Michel Marcus, Jan 15 2017

Formula

a(n) = O(n/log(n)). a(n) <= phi(n), a(n) = phi(n) for n = 2, 6, and 10. a(n) <= phi(2n)/2, a(n) = phi(2n)/2 for n = 2, 3, 5, 6, and 10. - Thomas Ordowski, Mar 01 2017

Extensions

Entries checked by Franklin T. Adams-Watters, May 05 2006

A220554 Number of ways to write 2n = p+q (q>0) with p, 2p+1 and (p-1)^2+q^2 all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 15 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>1.
This has been verified for n up to 2*10^8. It implies that there are infinitely many Sophie Germain primes.
Note that Ming-Zhi Zhang asked (before 1990) whether any odd integer greater than 1 can be written as x+y (x,y>0) with x^2+y^2 prime, see A036468.
Zhi-Wei Sun also made the following related conjectures:
(1) Any integer n>2 can be written as x+y (x,y>=0) with 3x-1, 3x+1 and x^2+y^2-3(n-1 mod 2) all prime.
(2) Each integer n>3 not among 20, 40, 270 can be written as x+y (x,y>0) with 3x-2, 3x+2 and x^2+y^2-3(n-1 mod 2) all prime.
(3) Any integer n>4 can be written as x+y (x,y>0) with 2x-3, 2x+3 and x^2+y^2-3(n-1 mod 2) all prime. Also, every n=10,11,... can be written as x+y (x,y>=0) with x-3, x+3 and x^2+y^2-3(n-1 mod 2) all prime.
(4) Any integer n>97 can be written as p+q (q>0) with p, 2p+1, n^2+pq all prime. Also, each integer n>10 can be written as p+q (q>0) with p, p+6, n^2+pq all prime.
(5) Every integer n>3 different from 8 and 18 can be written as x+y (x>0, y>0) with 3x-2, 3x+2 and n^2-xy all prime.
All conjectures verified for n up to 10^9. - Mauro Fiorentini, Sep 21 2023

Examples

			a(16)=1 since 32=11+21 with 11, 2*11+1=23 and (11-1)^2+21^2=541 all prime.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 2nd Edition, Springer, New York, 2004, p. 161.

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[p]==True&&PrimeQ[2p+1]==True&&PrimeQ[(p-1)^2+(2n-p)^2]==True,1,0],{p,1,2n-1}]
    Do[Print[n," ",a[n]],{n,1,1000}]

A082519 Number of times that k^2 + (n-k)^2 is prime for 1 <= k <= n-1.

Original entry on oeis.org

1, 2, 0, 4, 0, 4, 0, 4, 0, 6, 0, 6, 0, 8, 0, 8, 0, 8, 0, 6, 0, 8, 0, 16, 0, 8, 0, 12, 0, 10, 0, 8, 0, 18, 0, 16, 0, 12, 0, 18, 0, 14, 0, 14, 0, 14, 0, 10, 0, 14, 0, 18, 0, 28, 0, 16, 0, 18, 0, 22, 0, 14, 0, 34, 0, 22, 0, 20, 0, 18, 0, 22, 0, 18, 0, 16, 0, 26, 0, 18, 0, 30, 0, 40, 0, 22, 0, 28, 0
Offset: 2

Views

Author

CHAUVIN thierry (thierry.chaun2(AT)wanadoo.fr), Apr 30 2003

Keywords

Examples

			a(5) = 4 because 1+16, 4+9, 9+4 and 16+1 are primes.
		

Crossrefs

Cf. A036468 (number of ways to represent 2n+1 as a+b with a^2+b^2 prime).

Programs

  • Mathematica
    Table[cnt=0; Do[If[PrimeQ[k^2+(n-k)^2], cnt++ ], {k, 1, n-1}]; cnt, {n, 2, 150}]
  • PARI
    A082519(n) = sum(k=1,n-1,isprime((k^2)+((n-k)^2))); \\ Antti Karttunen, Jan 22 2020

Formula

a(2) = 1, a(2n) = 0 for n>1 and a(2n+1) = 2*A036468(n) for n>0 - T. D. Noe, Oct 15 2004

Extensions

Edited and extended by T. D. Noe, Oct 15 2004

A281543 Number of partitions n = x + y with y >= x > 0 such that x^2 + y^2 or (x^2 + y^2)/2 is prime.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 4, 3, 4, 1, 4, 4, 3, 2, 4, 1, 8, 4, 4, 3, 6, 3, 5, 3, 4, 4, 9, 3, 8, 4, 6, 6, 9, 2, 7, 4, 7, 5, 7, 3, 5, 7, 7, 6, 9, 4, 14, 4, 8, 4, 9, 4, 11, 7, 7, 6, 17, 5, 11, 6, 10, 8, 9, 5, 11, 6, 9, 7, 8, 3, 13, 9, 9, 5, 15, 5, 20, 8, 11, 8, 14, 7, 13, 9, 8, 6, 18, 7, 14, 10, 10, 8
Offset: 1

Views

Author

Thomas Ordowski and Altug Alkan, Mar 01 2017

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
We have a(n) <= phi(n)/2 for n <> 2, because must be gcd(x,y) = 1.
Numbers n such that a(n) = phi(n)/2 are 3, 4, 5, 6, 10, 12, 15, and 20.
Record values of a(n) are for n = 1, 2, 5, 11, 15, 25, 35, 55, 65, 85, 125, 145, 185, 205, 215, 235, 265, 295, 325, 365, 415, ... cf. A001750.

Examples

			a(5) = 2 because 5 = 1 + 4 and 5 = 2 + 3 are only options; 1^2 + 4^2 = 17 and 2^2 + 3^2 = 13 are primes.
a(6) = 1 because 6 = 1 + 5 is only option; (1^2 + 5^2)/2 = 13 is prime.
a(7) = 2 because 7 = 1 + 6, 7 = 2 + 5 and 7 = 3 + 4, but 3^2 + 4^2 = 5^2.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n==2, 1, if(n%2==0, sum(k=1, n/2-1, isprime(n^2/4+k^2)), sum(k=1, (n-1)/2, isprime(k^2+(n-k)^2))));

Formula

a(2m+1) = A036468(m) for m > 0.
a(2m) = A069004(m) for m > 1.
a(n) = O(n/log(n)).

A159296 a(n) is the smaller number in the pair (L,m) which minimizes the primes of the form L^2 + m^2 under the constraint L + m = 2n + 1.

Original entry on oeis.org

1, 2, 2, 4, 5, 5, 7, 7, 9, 8, 10, 12, 10, 14, 11, 14, 17, 15, 19, 18, 20, 22, 22, 24, 25, 25, 23, 26, 29, 30, 29, 32, 30, 34, 35, 34, 34, 37, 39, 31, 40, 42, 41, 40, 43, 44, 47, 45, 40, 50, 50, 47, 51, 52, 53, 55, 54, 56, 55, 60, 59, 61, 62, 55, 65, 65, 64, 66, 69, 70, 64, 72, 67, 72, 65
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Apr 09 2009

Keywords

Comments

1) It is known that this sequence is infinite.
2) L and m with odd sum L + m are necessarily coprime if L^2 + M^2 is prime.
3) The "singular" case m = L = 1, L + m = 2 (even) with 1^2 + 1^2 = 2 is skipped. It would define a(0)=1.
4) a(n) <= n.
It has not been proved that a(n) exists for all n. See A036468. [T. D. Noe, Apr 22 2009]

Examples

			n=1: 1^2 + 2^2 = 5; a(1)=1.
n=2: 2^2 + 3^2 = 13 < 1^2 + 4^2 = 17; a(2)=2.
n=3: 2^2 + 5^2 = 29 < 1^2 + 6^2 = 37. 3^2 + 4^2 = 5^2 not prime; a(3)=2.
n=27: 23^2 + 32^2 = 1553 < 1597, 1657, 1693, 1733, 1777, 1877, 1933, 1993, 2273, 2437, 2617, 2713, 2917, a(27)=23.
		

Crossrefs

Programs

  • Maple
    A159296 := proc(n) local a,pmin,l,m ; a := 0 ; pmin := 2*(2*n+1)^2 ; for l from 1 to n do m := 2*n+1-l ; if isprime(m^2+l^2) then if m^2+l^2 < pmin then pmin := m^2+l^2 ; a := l ; fi; fi; od: RETURN(a) ; end: seq(A159296(n),n=1..80) ; # R. J. Mathar, Apr 18 2009

Extensions

Edited and extended by R. J. Mathar, Apr 18 2009

A232269 Number of ways to write 2*n + 1 = x + y (x, y > 0) with x^3 + y^2 and x^2 + y^2 both prime.

Original entry on oeis.org

1, 3, 1, 2, 3, 2, 1, 6, 4, 1, 4, 6, 3, 8, 1, 1, 6, 1, 1, 9, 2, 4, 5, 3, 1, 2, 7, 4, 5, 8, 1, 12, 4, 4, 12, 3, 4, 9, 10, 1, 5, 9, 5, 11, 7, 4, 9, 2, 4, 19, 1, 1, 14, 4, 6, 16, 8, 5, 8, 7, 2, 11, 8, 1, 16, 3, 5, 9, 4, 3, 8, 8, 6, 16, 4, 3, 12, 13, 5, 11, 5, 3, 10, 10, 7, 12, 7, 4, 17, 20, 1, 17, 5, 6, 15, 4, 5, 18, 5, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 22 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Also, any odd integer greater than one can be written as x + y (0 < x < y) with x^3 + y^2 prime.
The conjecture implies that there are infinitely many primes of the form x^3 + y^2 (x, y > 0) with x^2 + y^2 also prime.
Note that Ming-Zhi Zhang ever asked (cf. A036468) whether any odd integer greater than one can be written as x + y (x, y > 0) with x^2 + y^2 prime.

Examples

			a(10) = 1 since 2*10 + 1 = 1 + 20 with 1^2 + 20^2 = 1^3 + 20^2 = 401 prime.
a(15) = 1 since 2*15 + 1 = 25 + 6 with 25^2 + 6^2 = 661 and 25^3 + 6^2 = 15661 both prime.
a(40) = 1 since 2*40 + 1 = 55 + 26 with 55^2 + 26^2 = 3701 and 55^3 + 26^2 = 167051 both prime.
a(91) =1 since 2*91 + 1 = 85 + 98 with 85^2 + 98^2 = 16829 and 85^3 + 98^2 = 623729 both prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[x^3+(2n+1-x)^2]&&PrimeQ[x^2+(2n+1-x)^2],1,0],{x,1,2n}]
    Table[a[n],{n,1,100}]
Showing 1-10 of 17 results. Next