function res = chi(n,a,s)


r = 0;

if 0<mod(n/s,1)<2-s
    r = a;
else
    r = 0;
    
end

res = r;

end

