login
Final digit of the sum of all the integers from n to 2*n-1.
0

%I #19 Feb 19 2021 02:58:26

%S 1,5,2,2,5,1,0,2,7,5,6,0,7,7,0,6,5,7,2,0,1,5,2,2,5,1,0,2,7,5,6,0,7,7,

%T 0,6,5,7,2,0,1,5,2,2,5,1,0,2,7,5,6,0,7,7,0,6,5,7,2,0,1,5,2,2,5,1,0,2,

%U 7,5,6,0,7,7,0,6,5,7,2,0,1,5,2,2,5,1

%N Final digit of the sum of all the integers from n to 2*n-1.

%C Periodic with period 20. - _R. J. Mathar_, May 21 2010

%C Also, units digits of the pentagonal numbers. - _Ant King_, Jul 12 2011

%H <a href="/index/Rec#order_15">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1).

%F From _R. J. Mathar_, May 21 2010: (Start)

%F a(n) = A000326(n) mod 10.

%F a(n) = a(n-5) - a(n-10) + a(n-15). (End)

%F a(n) = a(n-20). - _Ant King_, Jul 12 2011

%F a(n) = 70 - a(n-1) - a(n-2) - a(n-3) - ... - a(n-19). - _Ant King_, Jul 12 2011

%e a(1) = 1 mod 10 = 1;

%e a(2) = (3 + 4 + 5) mod 10 = 12 mod 10 = 2;

%e a(21) = (21 + 22 + ... + 41) mod 10 = 651 mod 10 = 1.

%t Table[Mod[n*(3*n - 1)/2, 10], {n, 100}] (* _Ant King_, Jul 12 2011 *)

%t LinearRecurrence[{0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1},{1,5,2,2,5,1,0,2,7,5,6,0,7,7,0},90] (* _Harvey P. Dale_, Nov 01 2020 *)

%Y Cf. A000027, A000326.

%K nonn,base,easy

%O 1,2

%A _Juri-Stepan Gerasimov_, Jun 10 2009

%E Entries confirmed by _R. J. Mathar_, May 21 2010