OFFSET
1,3
COMMENTS
Numbers not ending in 2 or 7. - Bruno Berselli, Oct 30 2017
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..8000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(n) = floor((5*n-3)/4). - Gary Detlefs, Mar 06 2010
G.f.: x^2*(1 + 2*x + x^2 + x^3) / ( (1 + x)*(x^2 + 1)*(x - 1)^2 ). - R. J. Mathar, Oct 08 2011
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=1, b(1)=3, b(k)=5*2^(k-2) for k>1. - Philippe Deléham, Oct 17 2011
From Wesley Ivan Hurt, May 30 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (10*n-9-i^(2*n)+(1-i)*i^(-n)+(1+i)*i^n)/8, where i=sqrt(-1).
E.g.f.: (4 - sin(x) + cos(x) + (5*x - 4)*sinh(x) + 5*(x - 1)*cosh(x))/4. - Ilya Gutkovskiy, May 30 2016
Sum_{n>=2} (-1)^n/a(n) = log(5)/4 + 3*sqrt(5)*log(phi)/10 + sqrt(1-2/sqrt(5))*Pi/10, where phi is the golden ratio (A001622). - Amiram Eldar, Dec 07 2021
MAPLE
seq(floor((5*n-3)/4), n=1..57); # Gary Detlefs, Mar 06 2010
MATHEMATICA
Flatten[Table[5*n + {0, 1, 3, 4}, {n, 0, 20}]] (* T. D. Noe, Nov 12 2013 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 3, 4, 5}, 100] (* Harvey P. Dale, Jan 31 2022 *)
PROG
(PARI) forstep(n=0, 99, [1, 2, 1, 1], print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
(Magma) [n : n in [0..100] | n mod 5 in [0, 1, 3, 4]]; // Wesley Ivan Hurt, May 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved