Hacker News new | ask | show | jobs
by dilatedmind 2906 days ago
for the first 8 im getting 1,3,6,14,28,60,120,248
1 comments

Just a hunch but I think you might be skipping isosceles triangles. And possibly adding right angled triangles because of floating-point arithmetic.
how about 3,6,14,28,60,120,248,496?
Nope :( The sequence starts with 1 because there is just one triangle with an area of 2 that satisfies the conditions. I ended up with a sequence similar to your previous one when I forgot to take the absolute value of area -- x1(y2-y3) + x2(y3-y1) + x3*(y1-y2))/2 . That could be a possibility in case you were using the same formula. In your first result - 1, 3, 6, 14.... , first two are right, third over-counted and rest are undercounted.
Listed the solutions for n = 3 and 4 here. Could help you with debugging- https://imgur.com/a/fHS4tNd