谢谢 Treenewbee !继续讨教。
\(a(n)=\frac{n(n-1)}{2}*\bigg(1-\bigg\lceil FractionalPart\bigg(\sqrt{\frac{w*n(n-1)+2}{2}}\bigg)\bigg\rceil\bigg)\)
Table[(n (n - 1))/2 (1 - Ceiling[FractionalPart[Sqrt[(3 n (n - 1) + 2)/2]]]), {n, 1, 600}]
{0, 1, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2080,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11781, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,....
这些“0”应该怎样去掉(在这里, w=3)? |