OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
FORMULA
If 2*k - 1 is a prime, then a(k) = (2^k - 2*(-1)^floor(k/2))/(2*k - 1).
Conjecture: a(n) = 2*abs(A178738(n)).
EXAMPLE
a(5) = 4 because there are 4 subsets of {1, 3, 5, 7, 9} which sum to 0 modulo 9: {}, {9}, {1, 3, 5}, {1, 3, 5, 9}.
MAPLE
f:= proc(n) local V, k;
V:= Vector(2*n-1);
V[2*n-1]:= 1;
for k from 1 to 2*n-1 by 2 do
V:= V + V[[$(k+1)..(2*n-1), $1..k]]
od;
V[2*n-1]
end proc:
map(f, [$1..40]); # Robert Israel, May 12 2020
PROG
(PARI) a(n) = {my(v=Vec(prod(i=1, n, x^(2*i-1)+1))); sum(i=0, n^2\(2*n-1), v[n^2+1-i*(2*n-1)]); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Apr 30 2020
STATUS
approved