%I #26 Sep 08 2022 08:45:00
%S 0,1,11,20,22,30,33,40,44,50,55,60,66,70,77,80,88,90,99,100,110,110,
%T 121,120,132,130,143,140,154,150,165,160,176,170,187,180,198,190,209,
%U 200,220,210,231,220,242,230,253,240,264,250,275,260,286,270,297,280
%N a(n) = n-th triangular number (the sum of the first n integers) in base n.
%C Note that these numbers should be read in base n. For instance, a(19) = 100 is actually (10)(00) in base 19, which equals 190 (the 19th triangular number) in base 10. - _T. D. Noe_, Feb 01 2013
%H Harry J. Smith, <a href="/A053715/b053715.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F Apart from a(1), a(2n-1) = 10n and a(2n) = 11n.
%F From _Colin Barker_, Feb 01 2013: (Start)
%F a(n) = (-10*(-1+(-1)^n)+(21+(-1)^n)*n)/4 for n>1.
%F a(n) = 2*a(n-2)-a(n-4) for n>5.
%F G.f.: -x*(9*x^4-18*x^2-11*x-1) / ((x-1)^2*(x+1)^2). (End)
%e a(3) = 1 + 2 + 3 = 6 = 20_3.
%t Join[{0,1}, Table[FromDigits[IntegerDigits[n*(n+1)/2, n]], {n, 2, 50}]] (* _T. D. Noe_, Feb 01 2013 *)
%t Join[{0, 1}, LinearRecurrence[{0, 2, 0, -1}, {11, 20, 22, 30}, 60]] (* _Vincenzo Librandi_, Jan 04 2016 *)
%o (PARI) baseE(x, b)= { local(d, e=0, f=1); if (b<2, return(x)); while (x>0, d=x%b; x\=b; e+=d*f; f*=10); return(e) } { for (n=0, 1000, write("b053715.txt", n, " ", baseE(n*(n + 1)/2, n)) ) } \\ _Harry J. Smith_, Apr 27 2010
%o (Magma) I:=[0,1,11,20,22,30]; [n le 6 select I[n] else 2*Self(n-2)-Self(n-4): n in [1..60]]; // _Vincenzo Librandi_, Jan 04 2016
%Y Cf. A000217.
%K base,easy,nonn
%O 0,3
%A _Henry Bottomley_, Feb 10 2000
%E More terms from _James A. Sellers_, Feb 22 2000
|