A206824 Number of solutions (n,k) of s(k) = s(n) (mod n), where 1 <= k < n and s(k) = k(k+1)/2.
1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 1, 3, 2, 3, 2, 1, 2, 3, 2, 1, 4, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 4, 1, 2, 3, 1, 3, 4, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 1, 2, 1, 4, 3, 2, 3, 2, 1, 4, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2
Offset: 2
Keywords
Examples
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.
Links
- Michael De Vlieger, Table of n, a(n) for n = 2..30030
Programs
-
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 *)
Comments