The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A217585 Number of triangles with endpoints of the form (x,x^2), x in {-n,...,n}, having at least one angle of 45 degrees. 1
 0, 1, 5, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS Table of n, a(n) for n=0..62. Project Euler, Problem 397: Triangle on parabola, Oct 07 2012. Index entries for linear recurrences with constant coefficients, signature (2,-1). FORMULA a(n) = 4n-1 for n > 2. From Colin Barker, Sep 20 2014: (Start) a(n) = 2*a(n-1) - a(n-2) for n > 4. G.f.: -x*(2*x^3 - 2*x^2 - 3*x - 1) / (x-1)^2. (End) EXAMPLE For n=1, there is one such triangle, having its points at abscissas [a,b,c] = [-1,0,1]. For n=2, there are 4 more such triangles, with [a,b,c] = [-2, 1, 2], [-2, -1, 2], [-1, 1, 2] and [-2, -1, 1]. For n=3, there are 6 more such triangles, namely [a,b,c] = [-3, 0, 2]*, [-3, 2, 3], [-2, 2, 3] and the symmetric of these. The first one (marked *) is the first instance where the 45-degree angle is at the bottom and not on the left or right as for all others so far. PROG (PARI) A217585(n, dump=0)={my(c=0, C=180/45/Pi, S=100+n^2); forvec(v=vector(3, i, [if(i<2, -n), if(i>1, n)]), bestappr(abs(atan(v[2]+v[1])-atan(v[3]+v[1]))*C, S)==1 &c++ &!(dump&print1(v", ")) &(v[2]||c-=1/2) &next; bestappr(abs(atan(1/(v[2]-v[1]))+atan(1/(v[2]+v[3])))*C, S)==1 &c++ &!(dump&print1(v"*, ")) &(v[2]||c-=1/2) &next, 2); c*2} (PARI) concat(0, Vec(-x*(2*x^3-2*x^2-3*x-1)/(x-1)^2 + O(x^100))) \\ Colin Barker, Sep 20 2014 CROSSREFS Sequence in context: A314005 A164355 A287322 * A314006 A314007 A183227 Adjacent sequences: A217582 A217583 A217584 * A217586 A217587 A217588 KEYWORD nonn,easy AUTHOR M. F. Hasler, Oct 07 2012 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 19 09:40 EDT 2024. Contains 376007 sequences. (Running on oeis4.)