OFFSET
2,4
COMMENTS
a(n-1) = 0 for prime n.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..1000
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
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