OFFSET
1,7
LINKS
Wikipedia, Integer Triangle
FORMULA
a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} sign(floor((i+k)/(n-i-k+1)) * [c(i) = c(k) = c(n-i-k)], where [] is the Iverson bracket and c = A061358.
EXAMPLE
a(4) = 0; no triangles can be made.
a(7) = 2; The two triangles [1,3,3] and [2,2,3] both have perimeter 7, and in each case, the side lengths can be written as the sum of two primes in the same number of ways (0 ways).
a(12) = 1; The triangle [4,4,4] has perimeter 12 and all of its side lengths can be written as the sum of two primes in the same number of ways (1 way).
a(15) = 3; the triangles [4,4,7], [4,5,6] and [5,5,5] all have perimeter 15. In each triangle, all the side lengths can be written as the sum of two primes in the same number of ways (1 way).
MATHEMATICA
Table[Sum[Sum[KroneckerDelta[Sum[(PrimePi[r] - PrimePi[r - 1]) (PrimePi[k - r] - PrimePi[k - r - 1]), {r, Floor[k/2]}], Sum[(PrimePi[s] - PrimePi[s - 1]) (PrimePi[i - s] - PrimePi[i - s - 1]), {s, Floor[i/2]}], Sum[(PrimePi[t] - PrimePi[t - 1]) (PrimePi[(n - i - k) - t] - PrimePi[(n - i - k) - t - 1]), {t, Floor[(n - i - k)/2]}]]*Sign[Floor[(i + k)/(n - i - k + 1)]], {i, k, Floor[(n - k)/2]}], {k, Floor[n/3]}], {n, 100}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 15 2020
STATUS
approved