OFFSET
1,2
LINKS
G. E. Andrews, Further Problems on Partitions, Amer. Math. Monthly 94 (1987), no. 5, 437-439.
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,-2,2,-1).
FORMULA
From Colin Barker, Dec 01 2019: (Start)
G.f.: x*(1 + x)*(1 + x^3 + 2*x^4 - 4*x^5 + 7*x^6 - 7*x^7 + 8*x^8 - 8*x^9 + 9*x^10 - 8*x^11 + 9*x^12 - 8*x^13 + 8*x^14 - 7*x^15 + 7*x^16 - 4*x^17 + 2*x^18 + x^19 + x^22) / ((1 - x)^2*(1 - x + x^2)*(1 + x^2)*(1 + x + x^2)*(1 - x^2 + x^4)*(1 + x^4)*(1 - x^4 + x^8)).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - 2*a(n-4) + 2*a(n-5) - 2*a(n-6) + 2*a(n-7) - 2*a(n-8) + 2*a(n-9) - 2*a(n-10) + 2*a(n-11) - 2*a(n-12) + 2*a(n-13) - 2*a(n-14) + 2*a(n-15) - 2*a(n-16) + 2*a(n-17) - 2*a(n-18) + 2*a(n-19) - 2*a(n-20) + 2*a(n-21) - 2*a(n-22) + 2*a(n-23) - a(n-24) for n>24.
(End)
MAPLE
f:=proc(n, M, lis) local i; if member( n mod M, lis) or member( -n mod M, lis) then 1 else 0; fi; end;
lis3:=[1, 3, 4, 5, 9, 10, 11, 14, 15, 16, 17, 19];
lis := lis3;
a:=[];
for n from 1 to 200 do
if f(n, 40, lis) = 1 then a:=[op(a), n]; fi; od:
a;
MATHEMATICA
okQ[n_] := AnyTrue[Join[lis = {1, 3, 4, 5, 9, 10, 11, 14, 15, 16, 17, 19}, 40 - lis], Mod[n, 40] == #&];
Select[Range[200], okQ] (* Jean-François Alcover, Mar 09 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 29 2019
STATUS
approved