OFFSET
1,1
COMMENTS
Previous name was: "For each term in this sequence, n say, consider the fraction of square numbers between 1 & n, inclusive, when reduced to its lowest terms. This fraction will always have a numerator of 2 for numbers in this sequence".
To obtain similar fractions as above with a numerator of 1, for example 1/5 are square, there are three possible numbers, namely 15, 20, 25. In general it is fairly easy to show that for 1/k of the numbers up to n (1 to n inclusive) to be square, n takes one of the three values, k(k-2), k(k-1), k^2. This sequence looks at obtaining fractions of the form 2/k. Another sequence (A153194) looks at the 3/k case.
Alternately, numbers of the form 4n^2+n or 4n^2+3n. - Charles R Greathouse IV, Aug 05 2013
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
From Colin Barker, Mar 28 2014: (Start)
a(n) = (2*n+3)*(2*n-(-1)^n+1)/4.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5).
G.f.: -x*(x^2+2*x+5) / ((x-1)^3*(x+1)^2). (End).
EXAMPLE
22 has 4 square numbers below it and 4/22=2/11.
76 has 8 square numbers below it and 8/76=2/19.
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {5, 7, 18, 22, 39}, 50] (* Harvey P. Dale, Sep 23 2022 *)
PROG
(PARI) isok(n) = numerator(sqrtint(n)/n) == 2 \\ Michel Marcus, Aug 05 2013
(PARI) for(n=1, 9, print1(4*n^2+n", "4*n^2+3*n", ")) \\ Charles R Greathouse IV, Aug 05 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Anthony C Robin, Dec 20 2008
EXTENSIONS
Definition simplified and more terms added by Michel Marcus, Aug 05 2013
STATUS
approved