OFFSET
1,1
COMMENTS
Includes every prime and twin prime (as pairs of consecutive primes) congruent to 11 or 13 mod 30.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = (1/4)*(-1)^n*(3*(-1)^n*(10*n + 1) - 11) for n > 0.
From Colin Barker, Dec 07 2017: (Start)
G.f.: x*(11 + 2*x + 2*x^2) / ((1 - x)^2*(1 + x)).
a(n) = (15*n - 4) / 2 for n even.
a(n) = (15*n + 7) / 2 for n odd.
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 3.
(End)
a(n) = ceiling(15*n/2) + 5*(n mod 2) - 2 for n > 0. - Mikk Heidemaa, Sep 06 2018
a(n + 2) = a(n) + 15. - David A. Corneth, Sep 06 2018
a(n) = (11/2)*(n mod 2) + 15*n/2 - 2 for n > 0. - Mikk Heidemaa, Sep 08 2018
f(n) = 15*n - ((13*n + 17) mod 26) for n > 0 yields odd terms. - Mikk Heidemaa, Oct 28 2019
a(n) = 11*ceiling(1/2*n) + 2*n - 2 for n > 0. - Mikk Heidemaa, Nov 04 2019
E.g.f.: 2 + ((30*x + 3)*exp(x) - 11*exp(-x))/4. - David Lovler, Sep 08 2022
MATHEMATICA
ParallelMap[11 * Ceiling[#/2] + 2 * # - 2 &, Range@ 10^3]
CoefficientList[ Series[(2x^2 + 2x + 11)/((1 + x) (x - 1)^2), {x, 0, 60}], x] (* or *)
LinearRecurrence[{1, 1, -1}, {11, 13, 26}, 60] (* Robert G. Wilson v, Jan 09 2018 *)
Select[Range[500], MemberQ[{11, 13}, Mod[#, 15]] &] (* Vincenzo Librandi, Sep 06 2018 *)
11/2 * Mod[#, 2] + 15 * #/2 - 2 &/@ Range@ 500 (* Mikk Heidemaa, Sep 08 2018 *)
PROG
(PARI) Vec(x*(11 + 2*x + 2*x^2) / ((1 - x)^2*(1 + x)) + O(x^40)) \\ Colin Barker, Dec 07 2017
(PARI) a(n) = if(n%2, (15*n+7)/2, (15*n-4)/2); \\ Altug Alkan, Sep 06 2018
(PARI) a(n) = [11, -2][(n - 1)%2 + 1] + 15*(n \ 2) \\ David A. Corneth, Sep 06 2018
(Magma) [n: n in [1..500] | n mod 15 in [11, 13]]; // Vincenzo Librandi, Sep 06 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Nov 20 2017
EXTENSIONS
Name simplified by David A. Corneth, Sep 06 2018
STATUS
approved