OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..359
MAPLE
with(numtheory):
q:= (i, j)-> is(i/j, integer) and isprime(i/j):
b:= proc(s, l) option remember; `if`(s={}, 1, add(
`if`(q(l, j) or q(j, l), b(s minus{j}, j), 0), j=s))
end:
a:= n-> ((s-> add(b(s minus {j}, j), j=s))(divisors(n))):
seq(a(n), n=1..100); # Alois P. Heinz, Nov 26 2017
MATHEMATICA
q[i_, j_] := PrimeQ[i/j];
b[s_, l_] := b[s, l] = If[s == {}, 1, Sum[If[q[l, j] || q[j, l], b[s ~Complement~ {j}, j], 0], {j, s}]];
a[n_] := Function[s, Sum[b[s ~Complement~ {j}, j], {j, s}]][Divisors[n]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 12 2018, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth and N. J. A. Sloane, Nov 26 2017
STATUS
approved