A185636 a(n) = |{0 <= k < n: n+k and n+k^2 are both prime}|.
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, 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, 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
Offset: 1
Keywords
Examples
a(14)=1 since 3 is the only k among 0,...,13 with 14+k and 14+k^2 both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..20000
- Zhi-Wei Sun, Problems on combinatorial properties of primes, arXiv:1402.6641 [math.NT], 2014-2015.
- Zhi-Wei Sun, Conjectures on representations involving primes, 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 arXiv:1211.1588 [math.NT].)
Crossrefs
Cf. A035250.
Programs
-
Mathematica
a[n_]:=a[n]=Sum[If[PrimeQ[n+k]==True&&PrimeQ[n+k^2]==True,1,0],{k,0,n-1}] Do[Print[n," ",a[n]],{n,1,100}] nk[n_]:=Count[Range[0,n-1],?(And@@PrimeQ[n+{#,#^2}]&)]; Array[nk,100] (* _Harvey P. Dale, Jun 17 2014 *)
Comments