%I #42 Jan 21 2023 16:28:18
%S 0,2,2,2,1,2,3,1,2,3,2,3,3,1,4,2,2,3,2,2,2,5,3,3,5,2,5,6,3,4,3,3,4,4,
%T 3,5,9,3,6,5,2,6,5,3,5,3,4,5,3,4,3,4,4,4,7,3,9,14,2,8,2,4,8,6,4,3,8,2,
%U 5,9,4,7,5,2,6,4,6,12,6,4,4,7,4,8,8,3,6,8,4,8,8,5,11,4,6,5,11,7,12,10
%N a(n) = |{0 <= k < n: n+k and n+k^2 are both prime}|.
%C Conjecture: a(n) > 0 for all n > 1.
%C This conjecture has been verified for n up to 10^8. It is stronger than Bertrand's postulate proved by Chebyshev in 1850.
%C Zhi-Wei Sun also guessed the following refinement of the conjecture: For any integer n > 1456 there is an integer k among 0,...,n-1 such that n-k, n+k and n+k^2 are all prime; in other words, there is a prime p <= n such that 2n-p and n+(n-p)^2 are both prime.
%C For other refinements of the conjecture, the reader may consult arXiv:1211.1588.
%C The author also conjectured the following polynomial analogs:
%C (i) For a given integer polynomial f(x) of degree n > 0, there is an integer polynomial g(x) of degree at most n such that f(x)+g(x) and f(x)+g(x)^2 are both irreducible in Z[x].
%C (ii) Let F be a field with characteristic different from 2 and 3. If f(x) is an irreducible polynomial over F with degree n > 0, then there is a polynomial g(x) over F with deg(g) <= n such that f(x)+g(x)^2 is irreducible over F.
%C In a 2017 paper, the author announced a USD $100 prize for the first solution to his conjecture that for each n = 1,2,3,... there is an integer k among 0,...,n such that n+k and n+k^2 are both prime. - _Zhi-Wei Sun_, Dec 03 2017
%H Zhi-Wei Sun, <a href="/A185636/b185636.txt">Table of n, a(n) for n = 1..20000</a>
%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1402.6641">Problems on combinatorial properties of primes</a>, arXiv:1402.6641 [math.NT], 2014-2015.
%H Zhi-Wei Sun, <a href="http://maths.nju.edu.cn/~zwsun/176r.pdf">Conjectures on representations involving primes</a>, in: M. Nathanson (ed.), Combinatorial and Additive Number Theory II: CANT, New York, NY, USA, 2015 and 2016, Springer Proc. in Math. & Stat., Vol. 220, Springer, New York, 2017, pp. 279-310. (See also <a href="http://arxiv.org/abs/1211.1588">arXiv:1211.1588 [math.NT]</a>.)
%e a(14)=1 since 3 is the only k among 0,...,13 with 14+k and 14+k^2 both prime.
%t a[n_]:=a[n]=Sum[If[PrimeQ[n+k]==True&&PrimeQ[n+k^2]==True,1,0],{k,0,n-1}]
%t Do[Print[n," ",a[n]],{n,1,100}]
%t nk[n_]:=Count[Range[0,n-1],_?(And@@PrimeQ[n+{#,#^2}]&)]; Array[nk,100] (* _Harvey P. Dale_, Jun 17 2014 *)
%Y Cf. A035250.
%K nonn
%O 1,2
%A _Zhi-Wei Sun_, Dec 18 2012