|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|