%I #21 Sep 08 2022 08:45:58
%S 1,6,6,1,9,3,1,3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,3,1,
%T 3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,
%U 3,1,3,9,1,6,6,1,9,3,1,3,9,1,6,6,1,9,3
%N Digital roots of the nonzero hexagonal numbers.
%C This is a periodic sequence with period 9 and cycle 1,6,6,1,9,3,1,3,9 - which are also the coefficients of x in the numerator of the generating function.
%C a(n) = A010888(A000384(n)). - _Reinhard Zumkeller_, Jan 09 2013
%F a(n) = a(n-9), and as the sum of the terms contained in each cycle is 39 they also satisfy the eighth-order inhomogeneous recurrence a(n) = 39 - a(n-1) - a(n-2) - a(n-3) - a(n-4) - a(n-5) - a(n-6) - a(n-7) - a(n-8).
%F a(n) = 2 + cos(2/9*(n-5)*Pi) + cos(4/9*(n-5)*Pi) + cos(2/3*(n-5)*Pi) + cos(8/9*(n-5)*Pi) + cos(4/3*(n-5)*Pi) + cos(14/9*(n-5)*Pi) + cos(16/9*(n-5)*Pi) + cos((2 n Pi)/9) + cos((4 n Pi)/9) + cos((2 n Pi)/3) + cos((8 n Pi)/9) + cos((10 n Pi)/9) + cos((4 n Pi)/3) + cos((14 n Pi)/9) + cos((16 n Pi)/9) + cos(2/9 (2+5 n) Pi) + (8n + 5n^2 + 7n^3 + n^5 + n^7 + 6n^8) mod 9.
%F G.f.: x(1+6x+6x^2+x^3+9x^4+3x^5+x^6+3x^7+9x^8)/((1-x)(1+x+x^2)(1+x^3+x^6)).
%e The sixth nonzero hexagonal number is A000384(6)=66. As 6+6=12 and 1+2=3, this has digital root 3 and so a(6)=3.
%t DigitalRoot[n_]:=FixedPoint[Plus@@IntegerDigits[#]&,n];DigitalRoot[ # (2#-1)]&/@Range[63]
%t CoefficientList[Series[(1 + 6 x + 6 x^2 + x^3 + 9 x^4 + 3 x^5 + x^6 + 3 x^7 + 9 x^8)/((1 - x) (1 + x + x^2) (1 + x^3 + x^6)), {x, 0, 100}], x] (* _Vincenzo Librandi_, Aug 11 2015 *)
%t PadRight[{},120,{1,6,6,1,9,3,1,3,9}] (* _Harvey P. Dale_, Oct 02 2018 *)
%o (Haskell)
%o a194597 n = [1,6,6,1,9,3,1,3,9] !! a010878 (n-1)
%o -- _Reinhard Zumkeller_, Jan 09 2013
%o (Magma) &cat[ [1,6,6,1,9,3,1,3,9]: k in [1..10] ]; // _Vincenzo Librandi_, Aug 11 2015
%Y Cf. A000384.
%Y Cf. A010878, A010888.
%K nonn,easy,base
%O 1,2
%A _Ant King_, Aug 30 2011
|