OFFSET
1,1
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: 2*x*(1+x-x^2-x^3+x^4)/((1+x)^2*(1-x)^3). - Charles R Greathouse IV, Feb 03 2013
a(n) = 2*A134519(n). - R. J. Mathar, Feb 03 2013
MAPLE
A004738 := proc(n)
local f ;
f := floor(sqrt(n)+1/2) ;
f+1-abs(n-1-f^2) ;
end proc:
for n from 1 to 1600 do
if A004738(n) = 2 then
printf("%d, ", n) ;
end if;
end do: # R. J. Mathar, Feb 03 2013
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {2, 4, 6, 8, 12}, 80] (* Harvey P. Dale, Jun 16 2017 *)
PROG
(PARI) a(n)=(n^2+2*n+8+if(n%2, 2*n-5))/4 \\ Charles R Greathouse IV, Feb 03 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Apr 15 2003
EXTENSIONS
More terms from R. J. Mathar, Feb 03 2013
STATUS
approved