OFFSET
1,5
COMMENTS
Conjecture: a(n)>0 for all n=2,3,4,...
It is known that any prime p = 1 or -1 (mod 5) can be written uniquely in the form x(p)^2+3x(p)y(p)+y(p)^2 with x(p)>y(p)>0.
Zhi-Wei Sun also conjectured that
(sum_{p<N, p=1,-1(mod 5)}x(p))
/(sum_{p<N, p=1,-1(mod 5)}y(p))
has the limit 1+sqrt(5) as N tends to the infinity.
These conjectures are similar to the ones mentioned in the comments in A218585.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..20000
Zhi-Wei Sun, Conjectures involving primes and quadratic forms, arXiv preprint arXiv:1211.1588, 2012.
EXAMPLE
For n=12 we have a(12)=1 since x^2+3x(12-x)+(12-x)^2 with 0<x<=6 is prime only when x=5.
MATHEMATICA
a[n_]:=a[n]=Sum[If[PrimeQ[x^2+3x(n-x)+(n-x)^2]==True, 1, 0], {x, 1, n/2}]; Do[Print[n, " ", a[n]], {n, 1, 20000}]
Table[Count[IntegerPartitions[n, {2}], _?(PrimeQ[#[[1]]^2+3Times@@#+ #[[2]]^2]&)], {n, 110}] (* Harvey P. Dale, Feb 28 2018 *)
PROG
(PARI) A218654(n)=sum(x=1, n\2, isprime(x^2+(2*x+n)*(n-x))) \\ - M. F. Hasler, Nov 05 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Nov 03 2012
STATUS
approved