OFFSET
1,1
COMMENTS
Quasipolynomial of order 2 and degree 2. - Charles R Greathouse IV, Apr 12 2016
From Ray Chandler, Apr 13 2016: (Start)
Square roots of resulting squares gives A001651.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 2, -2, -1, 1).
FORMULA
G.f.: x*(2 + x + x^3 + 2*x^4)/((1 - x)^3*(1 + x)^2). - Ilya Gutkovskiy, Apr 12 2016
a(n) = (3/2)*n^2 + O(n). - Charles R Greathouse IV, Apr 12 2016
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>5. - Wesley Ivan Hurt, Apr 13 2016
EXAMPLE
a(3) = 7 because 3*7 - 5 = 16 = 4^2.
MAPLE
A271713:=n->`if`(issqr(3*n-5), n, NULL): seq(A271713(n), n=1..5000); # Wesley Ivan Hurt, Apr 13 2016
MATHEMATICA
Select[Range@ 2300, IntegerQ@ Sqrt[3 # - 5] &] (* Michael De Vlieger, Apr 12 2016 *)
PROG
(Magma) [ n: n in [0..2500] | IsSquare(3*n - 5)];
(PARI) is(n)=issquare(3*n-5) \\ Charles R Greathouse IV, Apr 12 2016
(PARI) a(n)=((n\2*3-(-1)^n)^2+5)/3 \\ Charles R Greathouse IV, Apr 12 2016
(Python)
from __future__ import division
A271713_list = [(n**2+5)//3 for n in range(10**6) if not (n**2+5) % 3] # Chai Wah Wu, Apr 13 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Apr 12 2016
STATUS
approved