A334125 Number of subsets of {1, 3, ..., 2*n-1} which sum to 0 modulo 2*n-1.
2, 2, 2, 2, 4, 6, 10, 18, 30, 54, 98, 178, 328, 608, 1130, 2114, 3974, 7490, 14170, 26890, 51150, 97542, 186420, 356962, 684784, 1315870, 2532410, 4880646, 9418806, 18199014, 35204650, 68174116, 132152842, 256415958, 497967282, 967879954, 1882725390, 3665038872
Offset: 1
Keywords
Examples
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}.
Links
- Robert Israel, Table of n, a(n) for n = 1..1000
Programs
-
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
-
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)]); }
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)).