login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A008954
Final digit of triangular number n*(n+1)/2.
12
0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0
OFFSET
0,3
FORMULA
a(1) = 1, a(n+1) = (a(n) + n + 1) mod 10.
Periodic with period 20: repeat [0,1,3,6,0,5,1,8,6,5,5,6,8,1,5,0,6,3, 1,0]. - Franklin T. Adams-Watters, Mar 13 2006
It follows that all triangular numbers end with a digit of 0, 1, 3, 5, 6, or 8, and thus none end with a digit of 2, 4, 7, or 9. - Harvey P. Dale, Dec 31 2014
a(n) = n*(n+1)/2 mod 10. - Ant King, Apr 26 2009
From R. J. Mathar, Apr 15 2010: (Start)
a(n) = a(n-5) - a(n-10) + a(n-15).
G.f.: x*(1 +3*x +6*x^2 +5*x^4 +5*x^6 +5*x^8 +6*x^10 +3*x^11 +x^12)/(1 -x^5 +x^10 -x^15). (End)
a(n) = A010879(A000217(n)). - Michel Marcus, May 26 2022
MAPLE
seq(mod(binomial(n+1, 2), 10), n = 0 .. 100); # G. C. Greubel, Sep 14 2019
MATHEMATICA
Table[Mod[n*(n+1)/2, 10], {n, 0, 100}]
LinearRecurrence[{0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1}, {0, 1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5}, 110] (* Harvey P. Dale, Dec 31 2014 *)
PROG
(PARI) a(n)=n*(n+1)/2%10 \\ Charles R Greathouse IV, Mar 05 2014
(Magma) [Binomial(n+1, 2) mod 10: n in [0..100]]; // G. C. Greubel, Sep 14 2019
(Sage) [Mod(binomial(n+1, 2), 10) for n in (0..100)] # G. C. Greubel, Sep 14 2019
(GAP) List([0..100], n-> (Binomial(n+1, 2) mod 10) ); # G. C. Greubel, Sep 14 2019
CROSSREFS
First differences of A111072.
Sequence in context: A278488 A367325 A038023 * A169890 A181907 A141703
KEYWORD
nonn,base,easy
STATUS
approved