login
Units' digits of the nonzero hexagonal numbers.
1

%I #23 Oct 04 2024 18:26:18

%S 1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,

%T 5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,

%U 3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0,1,6,5,8,5,6,1,0,3,0

%N Units' digits of the nonzero hexagonal numbers.

%C This is a periodic sequence with period 10 and cycle 1, 6, 5, 8, 5, 6, 1, 0, 3, 0.

%C As the sum of the terms contained in each cycle is 35 they also satisfy the ninth-order inhomogeneous recurrence a(n)=35-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).

%H Harvey P. Dale, <a href="/A194599/b194599.txt">Table of n, a(n) for n = 1..1000</a>

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

%F a(n) = a(n-10).

%F a(n) = (n*(2*n-1)) mod 10.

%F G.f. -x*(1+6*x+5*x^2+8*x^3+5*x^4+6*x^5+x^6+3*x^8) / ( (x-1)*(1+x)*(x^4+x^3+x^2+x+1)*(x^4-x^3+x^2-x+1) ). - _R. J. Mathar_, Aug 30 2011

%F a(n) = A010879(A000384(n)). - _Michel Marcus_, Aug 10 2015

%e The seventh nonzero hexagonal number is A000384(7)=91, which has units' digit 1. Hence a(7)=1.

%t Mod[# (2#-1),10] &/@Range[100]

%t Mod[PolygonalNumber[6,Range[100]],10] (* _Harvey P. Dale_, Oct 04 2024 *)

%Y Cf. A000384, A010879.

%K nonn,easy,base

%O 1,2

%A _Ant King_, Aug 30 2011