OFFSET
1,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-2,2,-1).
FORMULA
a(n) = a(n-22) + 30.
a(n) = a(n-1) + a(n-22) - a(n-23).
G.f.: x*(x^21 + x^19 + x^17 + x^16 + x^15 + x^13 + x^11 + x^10 + x^8 + x^7 + x^6 + x^4 + x^3 + x^2 + 1) / ((x - 1)^2*(x^10 - x^9 + x^8 - x^7 + x^6 - x^5 + x^4 - x^3 + x^2 - x + 1)*(x^10 + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1)).
MATHEMATICA
LinearRecurrence[{2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -1}, {1, 2, 3, 5, 7, 8, 9, 11, 13, 14, 15, 17, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29}, 71] (* Ray Chandler, Jul 12 2015 *)
PROG
(Magma) IsA186042:=func< n | exists{ k: k in [0..n div 2] | n in [2*k+1, 3*k+2, 5*k+3] } >; [ n: n in [1..100] | IsA186042(n) ];
(PARI) isok(n) = (n % 2) || ((n % 3)==2) || ((n % 5)==3); \\ Michel Marcus, Jul 26 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Feb 11 2011, Mar 09 2011
STATUS
approved