OFFSET
2,5
COMMENTS
Records at indices {(1), 2, 6, 15, 30, 105, 210, 1155, 2310, 15015, 30030, ...}. - Michael De Vlieger, Sep 22 2017
LINKS
Michael De Vlieger, Table of n, a(n) for n = 2..30030
FORMULA
EXAMPLE
s(6) = 21, and 6 divides exactly two of the numbers 21 - s(k) = {20, 18, 15, 11, 6} for k = 1, 2, ..., 5, so that a(6) = 2.
MATHEMATICA
s[k_] := k (k + 1)/2;
f[n_, k_] := If[Mod[s[n] - s[k], n] == 0, 1, 0];
t[n_] := Flatten[Table[f[n, k], {k, 1, n - 1}]]
a[n_] := Count[Flatten[t[n]], 1]
Table[a[n], {n, 2, 120}] (* A206824 *)
(* Second program: *)
Table[Total@ Flatten@ Table[Boole@ Divisible[Subtract @@ Thread[PolygonalNumber[{n, k}]], n ], {k, n - 1}], {n, 2, 105}] (* Michael De Vlieger, Sep 22 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 12 2012
STATUS
approved