OFFSET
1,1
COMMENTS
LINKS
Gerald Hillier and Didier Lachieze, Last Digit Composite.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
G.f.: x*(4+2*x+2*x^2+x^3+x^4)/((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (5*n+1-(-1)^n+(3+(-1)^n)*(-1)^((2*n-3-(-1)^n)/4)/2)/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(10-2*sqrt(5))*Pi - sqrt(5)*arccoth(3/sqrt(5)) - 4*log(2))/20. - Amiram Eldar, Jul 30 2024
MATHEMATICA
Table[(5n+1-(-1)^n+(3+(-1)^n)*(-1)^((2n-3-(-1)^n)/4)/2)/2, {n, 100}]
LinearRecurrence[{1, 0, 0, 1, -1}, {4, 6, 8, 9, 14}, 80] (* Vincenzo Librandi, Sep 21 2015 *)
CoefficientList[Series[(4 + 2*x + 2*x^2 + x^3 + x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 80}], x] (* Wesley Ivan Hurt, Sep 21 2015 *)
Select[Range[200], CompositeQ[Mod[#, 10]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 21 2019 *)
PROG
(Magma) [(5*n+1-(-1)^n+(3+(-1)^n)*(-1)^((2*n-3-(-1)^n) div 4) div 2) div 2: n in [1..70]]; // Vincenzo Librandi, Sep 21 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Wesley Ivan Hurt, Sep 21 2015
EXTENSIONS
Name edited by Jon E. Schoenfield, Feb 15 2018
STATUS
approved