login
A331503
a(n) is the number of sets modulo n which can be formed by a finite arithmetic sequence.
0
1, 3, 7, 15, 31, 42, 99, 119, 193, 218, 463, 340, 807, 682, 849, 1087, 1939, 1299, 2775, 1862, 2615, 3050, 5107, 2988, 5681, 5242, 6439, 5656, 10615, 5562, 13083, 9631, 11367, 12362, 14153, 10531, 22719, 17578, 19361, 16050, 31243, 16728, 36207, 24284, 26133
OFFSET
1,2
FORMULA
a(n) = sigma(n) + n*(tau(n) - 1 - 3*floor(n/2) + Sum_{i=1..floor(n/2)} n/gcd(n,i)).
EXAMPLE
For n = 3, the a(3) = 7 solutions are {1}; {2}; {3}; {1,2}; {1,3}; {2,3}; {1,2,3}.
MATHEMATICA
Array[#3 + #1 (#2 - 1 - 3 #4 + Sum[#1/GCD[#1, i], {i, #4}]) & @@ Join[{#}, DivisorSigma[{0, 1}, #], {Floor[#/2]}] &, 45] (* Michael De Vlieger, May 04 2020 *)
PROG
(PARI) a(n) = {sigma(n) + n*(numdiv(n) - 1 - 3*(n\2) + sum(i=1, n\2, n/gcd(n, i)))} \\ Andrew Howroyd, May 03 2020
CROSSREFS
Cf. A000005 (tau), A000203 (sigma).
Sequence in context: A275532 A212315 A043729 * A137170 A222813 A304078
KEYWORD
nonn
AUTHOR
Brian Barsotti, May 03 2020
STATUS
approved