%I #34 Aug 04 2024 01:26:35
%S 1,3,6,1,1,2,2,3,4,5,6,7,9,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,
%T 6,6,7,7,7,8,8,9,9,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,
%U 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4
%N a(n) is the leading digit of the n-th triangular number, n*(n+1)/2.
%H Reinhard Zumkeller, <a href="/A008953/b008953.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = A000030(A000217(n)). - _Reinhard Zumkeller_, May 12 2010
%t Array[IntegerDigits[# (# + 1) / 2][[1]]&, 100] (* _Vincenzo Librandi_, Apr 12 2019 *)
%t IntegerDigits[#][[1]]&/@Accumulate[Range[100]] (* _Harvey P. Dale_, Oct 15 2022 *)
%o (PARI) a(n) = digits(n*(n+1)/2)[1]; \\ _Michel Marcus_, Jun 20 2018
%o (Magma) [Intseq((n*(n+1) div 2))[#Intseq((n*(n+1) div 2))]: n in [1..100]]; // _Vincenzo Librandi_, Apr 12 2019
%Y Cf. A000030, A000217, A008954. - _Reinhard Zumkeller_, May 12 2010
%K nonn,base,easy
%O 1,2
%A _N. J. A. Sloane_