OFFSET
1,1
COMMENTS
Numbers ending in 2, 3, 5 or 7.
The subsequence of primes is A042993. - Michel Marcus, Jul 19 2015
From Wesley Ivan Hurt, Aug 15 2015, Sep 26 2015: (Start)
Ceiling(a(n)/2) = A047201(n).
LINKS
Muniru A Asiru, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
G.f.: x*(2+x+2*x^2+2*x^3+3*x^4) / ((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1)+a(n-4)-a(n-5), n>5.
a(n) = (5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = (2*sqrt(5*sqrt(5+2*sqrt(5))) - 25*log(5) - 40*log(2) + 5*sqrt(5)*arccoth(843/2))/200. - Amiram Eldar, Jul 30 2024
MAPLE
MATHEMATICA
CoefficientList[Series[(2 + x + 2 x^2 + 2 x^3 + 3 x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x]
LinearRecurrence[{1, 0, 0, 1, -1}, {2, 3, 5, 7, 12}, 60] (* Vincenzo Librandi, Jul 18 2015 *)
Table[(5n - 4 - (-1)^n + ((3 - (-1)^n)/2)*(-1)^((2*n + 5 - (-1)^n)/4))/2, {n, 100}] (* Wesley Ivan Hurt, Aug 11 2015 *)
PROG
(Magma) [(5*n-4-(-1)^n+((3-(-1)^n) div 2)*(-1)^((2*n+5-(-1)^n) div 4))/2: n in [1..70]]; // Vincenzo Librandi, Jul 18 2015
(PARI) is(n)=my(m=digits(n)); isprime(m[#m]) \\ Anders Hellström, Jul 19 2015
(PARI) A260181(n)=(n--)\4*10+prime(n%4+1) \\ is(n)=isprime(n%10) is much more efficient than the above. - M. F. Hasler, Sep 16 2016
(GAP) a:=n->(5*n-4-(-1)^n+((3-(-1)^n)/2)*(-1)^((2*n+5-(-1)^n)/4))/2; List([1..60], n->a(n)); # Muniru A Asiru, Feb 16 2018
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Wesley Ivan Hurt, Jul 17 2015
STATUS
approved