login
Number of integer-sided triangles with one side having length n and an adjacent angle of 60 degrees.
2

%I #46 Aug 14 2022 23:38:22

%S 1,1,2,1,3,2,3,4,3,3,3,2,3,3,7,6,3,3,3,3,7,3,3,7,5,3,4,3,3,7,3,8,6,3,

%T 10,3,3,3,6,11,3,7,3,3,10,3,3,12,5,5,6,3,3,4,10,10,6,3,3,7,3,3,10,10,

%U 10,6,3,3,6,10,3,10,3,3,11,3,10,6,3,18,5,3,3,7,9,3,6,10,3,10,10

%N Number of integer-sided triangles with one side having length n and an adjacent angle of 60 degrees.

%C All terms are greater than or equal to 1 because a triangle with side lengths {n, n, n} is equilateral and has an adjacent angle of 60 degrees.

%C Number of possible integer solutions to the equation n^2 + x^2 - nx = y^2.

%C x <= n^2 and y <= n^2. - _Seiichi Manyama_, Dec 09 2021

%C From _David A. Corneth_, Dec 10 2021: (Start)

%C Solving n^2 + x^2 - nx = y^2 for x using the quadratic formula gives x = (n +- sqrt(4*y^2 - 3*n^2)) / 2.

%C So we need sqrt(4*y^2 - 3*n^2) to be an integer, say k, i.e., sqrt(4*y^2 - 3*n^2) = k.

%C Squaring gives 4*y^2 - 3*n^2 = k^2, i.e., (2y - k)*(2y + k) = 4*y^2 - k^2 = 3*n^2

%C Checking divisors d of 3*n^2 gives all candidates for y = (d + 3*n^2/d)/4 and x = (n +- sqrt(4*y^2 - 3*n^2)) / 2 which must be positive. (End)

%H David A. Corneth, <a href="/A350013/b350013.txt">Table of n, a(n) for n = 1..10000</a>

%e For n = 8, there are 4 possible integer triangles with side length 8 and adjacent angle 60 degrees. Their side lengths are {8, 3, 7}, {8, 5, 7}, {8, 8, 8}, {8, 15, 13}.

%o (PARI) a(n) = sum(x=1, n^2, issquare(x^2 - n * x + n^2)); \\ _David A. Corneth_, Dec 09 2021

%o (PARI) a(n) = { my(n23 = 3*n^2, d = divisors(n23), res = 0); for(i = 1, (#d + 1)\2, y = (d[i] + n23/d[i])/4; if(denominator(y) == 1, x = (n + sqrtint(4*y^2 - n23))/2; if(denominator(x) == 1, res++ ); x = (n - sqrtint(4*y^2 - n23))/2; if(x > 0 && denominator(x) == 1, res++ ); ) ); res } \\ faster than above \\ _David A. Corneth_, Dec 10 2021

%Y Cf. A121992, A201223, A264826.

%K nonn,easy

%O 1,3

%A _Joseph C. Y. Wong_, Dec 08 2021

%E More terms from _David A. Corneth_, Dec 09 2021