OFFSET
1,5
EXAMPLE
A087054(5) = 71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2, therefore a(5) = 2.
MATHEMATICA
nn = 100; A087854 = Take[Select[ Union[Total[Times @@@ Subsets[#, {2}]] & /@ Subsets[Prime[Range[nn]], {3}]], PrimeQ], nn]; r[n_, p_] := Reduce[p < q < r && p*q+q*r+r*p == n, {q, r}, Primes]; a[n_] := (For[cnt = 0; p = 2, p <= Ceiling[(n-6)/5], p = NextPrime[p], rnp = r[n, p]; If[rnp =!= False, Which[rnp[[0]] === And, Print["n = ", n, " ", {p, q, r} /. ToRules[rnp]]; cnt++, rnp[[0]] === Or, Print["n = ", n, " ", {p, q, r} /. {ToRules[rnp]}]; cnt += Length[rnp], True, Print["error: n = ", n, " ", rnp]]]]; cnt); Reap[Do[ap = a[p]; If[ap > 0, Sow[ap]], {p, A087854}]][[2, 1]] (* after Harvey P. Dale *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-François Alcover, Feb 26 2014
STATUS
approved