OFFSET
1,1
COMMENTS
Sequence A218771 is the subsequence of primes in this sequence.
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..7196 (all terms below 10^6).
EXAMPLE
a(1) = 20 = p^2+3pq+q^2 for p=q=2, in the same way all numbers of the form 5p^2 are member of the sequence.
a(2) = 31 = p^2+3pq+q^2 for p=2, q=3.
a(25) = 671 = p^2+3pq+q^2 for (p,q)=(2,23) and (5,19), is the least term to allow more than 1 decomposition.
a(1431) = 136895 = p^2+3pq+q^2 for (p,q)=(2,367), (67,277) and (103,233), is the least term to allow more than 2 decompositions.
MATHEMATICA
nf[{a_, b_}]:=a^2+3a*b+b^2; Take[Union[nf/@Tuples[Prime[Range[20]], 2]], 50] (* Harvey P. Dale, Mar 31 2015 *)
PROG
(PARI) is_A218793(n, v=0)={ /* set v=1 to count number of decompositions, and v=2 to print them */ my(r, c=0); forprime( q=1, sqrtint(n\5), issquare(4*n+5*q^2, &r) || next; isprime((r-3*q)/2) || next; v || return(1); v>1 & print1([q, (r-3*q)/2]", "); c++); c}
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Nov 05 2012
STATUS
approved