login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A064381
Number of subsets of {2,...,n} such that the product of their elements is congruent to 0 (mod n+1).
1
0, 0, 0, 6, 0, 24, 32, 120, 0, 792, 0, 2016, 5760, 13056, 0, 55136, 0, 226944, 387072, 523776, 0, 4112000, 5767168, 8386560, 30408704, 58669056, 0, 259541376, 0, 1062731776, 1609039872, 2147450880, 7927234560, 17103136768, 0, 34359607296, 103054049280
OFFSET
2,4
COMMENTS
a(n-1) = 0 for prime n.
LINKS
EXAMPLE
a(5) = 6 because there are 6 subsets of {2,3,4,5} such that the product of their elements is congruent to 0 (mod 6): {3,4,5}, {2,3,4,5}, {3,4}, {2,3}, {2,3,4}, {2,3,5}.
MAPLE
a:= proc(n) option remember; local m, b; m, b:= n+1,
proc(n, p) option remember; `if`(p=0, 2^(n-1),
`if`(n<2, 0, b(n-1, p)+b(n-1, p*n mod m)))
end: forget(b): b(n, 1)
end:
seq(a(n), n=2..50); # Alois P. Heinz, May 26 2013, revised Apr 25 2022
MATHEMATICA
b[n_, p_, m_] := b[n, p, m] = If[p == 0, 2^(n-1),
If[n < 2, 0, b[n-1, p, m] + b[n-1, Mod[p*n , m], m]]];
a[n_] := b[n, 1, n+1];
Table[a[n], {n, 2, 50}] (* Jean-François Alcover, Apr 25 2022, after Alois P. Heinz *)
CROSSREFS
Cf. A000048.
Sequence in context: A082731 A272673 A167357 * A062254 A028849 A287470
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Sep 27 2001
EXTENSIONS
More terms from Naohiro Nomoto, Oct 01 2001
Extended beyond a(24) by Alois P. Heinz, May 26 2013
STATUS
approved