cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070088 Number of integer-sided triangles with perimeter n and prime sides.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 1, 2, 0, 1, 0, 1, 0, 1, 1, 2, 0, 3, 1, 3, 0, 2, 0, 2, 0, 3, 1, 3, 0, 5, 1, 5, 0, 4, 0, 3, 0, 5, 1, 5, 0, 4, 0, 4, 0, 2, 0, 3, 0, 5, 1, 3, 0, 6, 1, 8, 0, 5, 0, 5, 0, 4, 0, 3, 0, 5, 1, 6, 0, 6, 0, 4, 0, 7, 1, 7, 0, 9, 1, 10, 0
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Examples

			For n=15 there are A005044(15)=7 integer triangles: [1,7,7], [2,6,7], [3,5,7], [3,6,6], [4,4,7], [4,5,6] and [5,5,5]: two of them consist of primes, therefore a(15)=2.
		

Crossrefs

Programs

  • Mathematica
    triangleQ[sides_] := With[{s = Total[sides]/2}, AllTrue[sides, # < s&]];
    a[n_] := Select[IntegerPartitions[n, {3}, Select[Range[Ceiling[n/2]], PrimeQ]], triangleQ] // Length; Array[a, 90] (* Jean-François Alcover, Jul 09 2017 *)
    Table[Sum[Sum[(PrimePi[i] - PrimePi[i - 1]) (PrimePi[k] - PrimePi[k - 1]) (PrimePi[n - i - k] - PrimePi[n - i - k - 1]) Sign[Floor[(i + k)/(n - i - k + 1)]], {i, k, Floor[(n - k)/2]}], {k, Floor[n/3]}], {n, 100}] (* Wesley Ivan Hurt, May 13 2019 *)

Formula

a(n) = A070090(n) + A070092(n) = A070095(n) + A070103(n).
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 c = A010051. - Wesley Ivan Hurt, May 13 2019