A105332 a(n) = n*(n+1)/2 mod 8.
0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4, 5, 7, 2, 6, 3, 1, 0, 0, 1, 3, 6, 2, 7, 5, 4, 4
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1).
Programs
-
Mathematica
Mod[Accumulate[Range[0,110]],8] (* Harvey P. Dale, Nov 03 2013 *)
-
Python
def A105332(n): return (n*(n+1)>>1)&7 # Chai Wah Wu, Apr 17 2025
Comments