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

A069003 Smallest integer d such that n^2 + d^2 is a prime number.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 4, 7, 2, 1, 2, 1, 2, 5, 6, 1, 4, 5, 8, 1, 4, 1, 2, 5, 4, 11, 4, 3, 2, 5, 2, 1, 2, 3, 10, 1, 4, 5, 8, 9, 2, 5, 2, 13, 4, 7, 4, 3, 10, 1, 4, 1, 2, 3, 6, 13, 10, 3, 32, 9, 2, 1, 2, 5, 10, 3, 6, 5, 2, 1, 4, 5, 10, 7, 4, 7, 4, 3, 18, 1, 2, 9, 2, 3, 4, 1, 4, 7, 8, 1, 2, 5, 2, 3, 4, 3
Offset: 1

Views

Author

T. D. Noe, Apr 02 2002

Keywords

Comments

With i being the imaginary unit, n + di is the smallest Gaussian prime with real part n and a positive imaginary part. Likewise for n - di. See A002145 for Gaussian primes with imaginary part 0. - Alonso del Arte, Feb 07 2011
Conjecture: a(n) does not exceed 4*sqrt(n+1) for any positive integer n. - Zhi-Wei Sun, Apr 15 2013
Conjecture holds for the first 15*10^6 terms. - Joerg Arndt, Aug 19 2014
Infinitely many d exist such that n^2 + d^2 is prime, under Schinzel's Hypothesis H; see Sierpinski (1988), p. 221. - Jonathan Sondow, Nov 09 2015

Examples

			a(5)=2 because 2 is the smallest integer d such that 5^2+d^2 is a prime number.
		

References

  • W. Sierpinski, Elementary Theory of Numbers, 2nd English edition, revised and enlarged by A. Schinzel, Elsevier, 1988.

Crossrefs

Cf. A068486 (lists the prime numbers n^2 + d^2).
Cf. A239388, A239389 (record values).
Cf. A053000.

Programs

  • Maple
    f:= proc(n) local d;
         for d from 1+(n mod 2) by 2 do
           if isprime(n^2+d^2) then return d fi
         od
    end proc:
    f(1):= 1:
    map(f, [$1..1000]); # Robert Israel, Jul 06 2015
  • Mathematica
    imP4P[n_] := Module[{k = 1}, While[Not[PrimeQ[n^2 + k^2]], k++]; k]; Table[imP4P[n], {n, 50}] (* Alonso del Arte, Feb 07 2011 *)
  • PARI
    a(n)=my(k);while(!isprime(n^2+k++^2),);k \\ Charles R Greathouse IV, Mar 20 2013

A238457 a(n) = |{0 < k <= n: p(n) + k is prime}|, where p(.) is the partition function (A000041).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 27 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 2, 3, 4, 5, 30, 109. Also, for each n > 2 there is a positive integer k <= n+3 such that p(n) - k is prime.
(ii) For the strict partition function q(.) given by A000009, we have |{0 < k <= n: q(n) + k is prime}| > 0 for all n > 0 and |{0 < k <= n: q(n) - k is prime}| > 0 for all n > 4.

Examples

			a(5) = 1 since p(5) + 4 = 7 + 4 = 11 is prime.
a(30) = 1 since p(30) + 19 = 5604 + 19 = 5623 is prime.
a(109) = 1 since p(109) + 63 = 541946240 + 63 = 541946303 is prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_,k_]:=PrimeQ[PartitionsP[n]+k]
    a[n_]:=Sum[If[p[n,k],1,0],{k,1,n}]
    Table[a[n],{n,1,100}]

A204065 Least nonnegative integer k with n+k and n+k^2 both prime.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 2, 1, 0, 1, 0, 3, 16, 1, 0, 7, 4, 15, 2, 1, 0, 1, 0, 9, 8, 3, 6, 1, 0, 3, 2, 1, 0, 1, 0, 3, 8, 1, 0, 5, 10, 3, 10, 1, 0, 5, 4, 15, 2, 1, 0, 1, 0, 21, 4, 3, 6, 1, 0, 15, 2, 1, 0, 1, 0, 33, 8, 25, 6, 1, 0, 3, 16, 1, 0, 5, 4, 15, 14, 1, 0, 7, 6, 9, 4, 3, 6, 1, 0, 3, 2, 1
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 09 2013

Keywords

Comments

Conjecture: For any n > 0 not among 1, 21, 326, 341, 626, we have a(n) < sqrt(n)*log(n). If n > 626 is not equal to 971, then n+k and n+k^2 are both prime for some 0< k < sqrt(n)*log(n). Also, n+k^2 is prime for some 0< k <= sqrt(n) if n > 43181.
Obviously, a(n)=0 iff n is a prime. - M. F. Hasler, Jan 11 2013

Examples

			a(8)=3 since 8+3 and 8+3^2 are both prime, but none of 8, 8+1, 8+2 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[PrimeQ[n+k]==True&&PrimeQ[n+k^2]==True,Print[n," ",k];Goto[aa]],{k,0,n}];
    Label[aa];Continue,{n,1,100}]
  • PARI
    a(n)=my(k=0); while(!isprime(n+k) || !isprime(n+k^2), k++); k \\ - M. F. Hasler, Jan 11 2013

A210531 Number of nonnegative integers k

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 28 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>0. Moreover, if n>0 is different from 74, 138, 166, 542, then n+k^3 is practical for some 0<=k<=sqrt(n)*log(n); if n is not equal to 102, then n+k and n+k^3 are both practical for some k=0,...,n-1.
Zhi-Wei Sun also conjectured that any integer n>1 can be written as x^3+y (x,y>0) with 2x and 4xy both practical.

Examples

			a(22)=1 since 22+2^3=30 is practical.
		

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[n+k^3]==True,1,0],{k,0,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

A185150 Number of odd primes p between n^2 and (n+1)^2 with (n/p) = 1, where (-) is the Legendre symbol.

Original entry on oeis.org

1, 1, 2, 3, 2, 2, 2, 3, 3, 1, 4, 2, 4, 3, 5, 7, 2, 3, 4, 6, 5, 3, 3, 4, 8, 5, 4, 5, 4, 4, 6, 6, 6, 4, 9, 9, 7, 7, 5, 6, 7, 5, 9, 5, 7, 3, 9, 6, 10, 6, 10, 6, 8, 8, 7, 7, 10, 3, 12, 8, 7, 10, 8, 14, 11, 7, 10, 10, 5, 9, 11, 8, 7, 9, 9, 18, 11, 11, 12, 9, 20, 6, 13, 6, 10, 9, 13, 9, 8, 10, 10, 12, 12, 6, 13, 9, 12, 12, 8, 23
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 29 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>0.
This is a refinement of Legendre's conjecture that for each n=1,2,3,... the interval (n^2,(n+1)^2) contains a prime.
We have verified the conjecture for n up to 10^9.
Zhi-Wei Sun also made some similar conjectures involving primes and Legendre symbols, below are few examples:
(1) If n>10 then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((1-n)/p) = 1. If n>2 is different from 7 and 17, then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((n+1)/p) = 1. If n>1 is not equal to 27, then there is a prime p between n^2 and (n+1)^2 with (n/p) = ((n+2)/p) = 1.
(2) If n>2 is different from 6, 12, 58, then there is a prime p between n^2 and n^2+n such that (n/p) = 1. If n>20 is not a square, and different from 37 and 77, then there is a prime p between n^2 and n^2+n such that (n/p) = -1.
(3) For each n=15,16,... there is a prime p between n and 2n such that (n/p) = 1. If n>0 is not a square, then
there is a prime p between n and 2n such that (n/p) = -1.

Examples

			a(10)=1 since 107 is the only prime p between 10^2 and 11^2 with (10/p) = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[n^2+k>2&&PrimeQ[n^2+k]==True&&JacobiSymbol[n,n^2+k]==1,1,0],{k,1,2n}]
    Do[Print[n," ",a[n]],{n,1,100}]

A227898 Number of primes p < n with p + 6 and n + (n - p)^2 both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 14 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5.
(ii) For any integer n > 5, there is a prime p with p + 6 and n*(n - p) - 1 both prime.

Examples

			a(6) = 1 since 5, 5 + 6 = 11 and 6 + (6 - 5)^2 = 7 are all prime.
		

Crossrefs

Programs

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

A227899 Number of primes p < n with 3*p - 4 and n^2 + (n - p)^2 both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 14 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.

Examples

			a(5) = 1 since 5 = 3 + 2, and the three numbers 3, 3*3 - 4 = 5 and 5^2 + (5-3)^2 = 29 are all prime.
		

Crossrefs

Programs

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

A237582 a(n) = |{0 < k < n: pi(n + k^2) is prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: (i) For each a = 2, 3, ... there is a positive integer N(a) such that for any integer n > N(a) there is a positive integer k < n with pi(n + k^a) prime. In particular, we may take (N(2), N(3), ..., N(9)) = (1, 1, 9, 26, 8, 9, 18, 1).
(ii) If n > 6, then pi(n^2 + k^2) is prime for some 0 < k < n. If n > 27, then pi(n^3 + k^3) is prime for some 0 < k < n. In general, for each a = 2, 3, ..., if n is sufficiently large then pi(n^a + k^a) is prime for some 0 < k < n.
For any integer n > 1, it is easy to show that pi(n + k) is prime for some 0 < k < n.

Examples

			a(5) = 1 since pi(5 + 1^2) = 3 is prime.
a(6) = 1 since pi(6 + 5^2) = pi(31) = 11 is prime.
a(9) = 2 since pi(9 + 3^2) = pi(18) = 7 and pi(9 + 5^2) = pi(34) = 11 are both prime.
a(12) = 1 since pi(12 + 10^2) = pi(112) = 29 is prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[PrimePi[n]]
    a[n_]:=Sum[If[p[n+k^2],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A261437 Least positive integer k such that k*n+1 = prime(p) and k^2*n+1 = prime(q) for some pair of primes p and q.

Original entry on oeis.org

2, 1, 286, 1, 7290, 21, 18, 2472, 12, 1, 20460, 20, 20692, 105, 4392, 1, 96816, 1327, 360, 264, 19850, 2734, 1854, 5293, 930, 29526, 98, 622, 9222, 1, 6816, 924, 61614, 70, 53760, 45, 32190, 9687, 5510, 1, 128070, 148, 8772, 23478, 404, 801, 1830, 5, 9912, 7662, 1100, 8211, 1116, 9997, 630, 4965, 936, 1, 87570, 759
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 18 2015

Keywords

Comments

Conjecture: (i) If n > 0 and r are relatively prime integers, then there are infinitely many positive integers k such that k*n+r = prime(p) for some prime p.
(ii) Let r be 1 or -1. For any integer n > 0, there is a positive integer k such that k*n+r = prime(p) and k^2*n+1 = prime(q) for some primes p and q.
(iii) For any integer n > 0, there is a positive integer k such that n+k = prime(p) and n+k^2 = prime(q) for some primes p and q.
Note that part (i) is a refinement of Dirichlet's theorem on primes in arithmetic progressions. Also, part (ii) implies that a(n) exists for any n > 0.

Examples

			a(3) = 286 since 286*3+1 = 859 = prime(149) with 149 prime, and 286^2*3+1 = 245389 = prime(21661) with 21661 prime.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    PQ[p_]:=PrimeQ[p]&&PrimeQ[PrimePi[p]]
    Do[k=0;Label[bb];k=k+1;If[PQ[k*n+1]&&PQ[k^2*n+1],Goto[aa],Goto[bb]];Label[aa];Print[n," ", k];Continue,{n,1,60}]

A187808 a(n) = |{0<=k

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 07 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>1. Moreover, if n>5 is different from 9, 191, 329, 641, 711, 979, then 2k-3, 2k+3, n(n-k)-1, n(n+k)-1 are all prime for some 0
Zhi-Wei Sun also made the following conjectures:
(1) For any integer n>101 there is an integer 0
(2) For each n=128,129,... there is an integer 0

Examples

			a(25) = 1 since 2*17+3 = 37, 25(25-17)-1 = 199, and 25(25+17)-1 = 1049 are all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[2k+3]==True&&PrimeQ[n(n-k)-1]==True&&PrimeQ[n(n+k)-1]==True,1,0],{k,0,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]
Showing 1-10 of 14 results. Next