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,-1,0,0,0,0,0,-1,2,-1,0,0,0,0,0,-1,2,-1).
FORMULA
From Colin Barker, Dec 01 2019: (Start)
G.f.: x*(1 + x)*(1 - x^2 + x^3 - x^4 + x^5 - x^6 + x^7 + x^9 - x^10 + x^11 - x^12 + x^13 - x^14 + x^16) / ((1 - x)^2*(1 - x + x^2)*(1 + x + x^2)*(1 - x^2 + x^4)*(1 - x^4 + x^8)).
a(n) = 2*a(n-1) - a(n-2) - a(n-8) + 2*a(n-9) - a(n-10) - a(n-16) + 2*a(n-17) - a(n-18) for n>18.
(End)
a(n) ~ 4*n/3. - Charles R Greathouse IV, May 21 2026
MAPLE
lis1:=[4, 6, 8, 10];
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;
a:=[];
for n from 1 to 200 do
if (n mod 2) = 1 or f(n, 32, lis1) = 1 then a:=[op(a), n]; fi; od:
a;
MATHEMATICA
okQ[n_] := OddQ[n] || AnyTrue[{4, 6, 8, 10, 22, 24, 26, 28}, Mod[n, 32] == #&];
Select[Range[100], okQ] (* Jean-François Alcover, Mar 09 2023 *)
PROG
(PARI) a(n)=(4*n+[-3, -1, 1, 0, -1, -2, -3, -4, -5, -6, -7, -5, -3, -1, 1, 3, 2, 1, 0, -1, -2, -3, -4, -5][n%24+1])/3 \\ Charles R Greathouse IV, May 21 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 29 2019
STATUS
approved
