login
A105333
a(n) = n*(n+1)/2 mod 16.
1
0, 1, 3, 6, 10, 15, 5, 12, 4, 13, 7, 2, 14, 11, 9, 8, 8, 9, 11, 14, 2, 7, 13, 4, 12, 5, 15, 10, 6, 3, 1, 0, 0, 1, 3, 6, 10, 15, 5, 12, 4, 13, 7, 2, 14, 11, 9, 8, 8, 9, 11, 14, 2, 7, 13, 4, 12, 5, 15, 10, 6, 3, 1, 0, 0, 1, 3, 6, 10, 15, 5, 12, 4, 13, 7, 2, 14, 11, 9, 8, 8, 9, 11, 14, 2, 7, 13, 4, 12
OFFSET
0,3
COMMENTS
Triangular numbers mod 16. - Harvey P. Dale, Oct 12 2012
Periodic with period length 32. - Ray Chandler, Apr 18 2025
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,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1).
FORMULA
From Chai Wah Wu, Apr 17 2025: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) - a(n-6) + a(n-7) - a(n-8) + a(n-9) - a(n-10) + a(n-11) - a(n-12) + a(n-13) - a(n-14) + a(n-15) - a(n-16) + a(n-17) - a(n-18) + a(n-19) - a(n-20) + a(n-21) - a(n-22) + a(n-23) - a(n-24) + a(n-25) - a(n-26) + a(n-27) - a(n-28) + a(n-29) - a(n-30) + a(n-31) for n > 30.
G.f.: x*(-x^28 - 2*x^27 - 4*x^26 - 6*x^25 - 9*x^24 + 4*x^23 - 16*x^22 + 12*x^21 - 25*x^20 + 18*x^19 - 20*x^18 + 6*x^17 - 17*x^16 + 8*x^15 - 16*x^14 + 8*x^13 - 17*x^12 + 6*x^11 - 20*x^10 + 18*x^9 - 25*x^8 + 12*x^7 - 16*x^6 + 4*x^5 - 9*x^4 - 6*x^3 - 4*x^2 - 2*x - 1)/((x - 1)*(x^2 + 1)*(x^4 + 1)*(x^8 + 1)*(x^16 + 1)). (End)
MATHEMATICA
Mod[#, 16]&/@Accumulate[Range[0, 90]] (* Harvey P. Dale, Oct 12 2012 *)
PROG
(Python)
def A105333(n): return (n*(n+1)>>1)&15 # Chai Wah Wu, Apr 17 2025
(PARI) a(n)=1613168760786662789121329248857645840\16^(n%32)%16 \\ Charles R Greathouse IV, Jun 03 2026
(PARI) a(n)=n*(n+1)/2%16 \\ Charles R Greathouse IV, Jun 03 2026
CROSSREFS
Cf. A000217.
See A105198 for further information.
Sequence in context: A104619 A194037 A194101 * A126234 A387660 A259604
KEYWORD
nonn,easy,changed
AUTHOR
Oscar Takeshita, May 01 2005
STATUS
approved