[go: up one dir, main page]

login
Triangular numbers with palindromic indices.
1

%I #17 Jun 11 2024 19:50:28

%S 0,1,3,6,10,15,21,28,36,45,66,253,561,990,1540,2211,3003,3916,4950,

%T 5151,6216,7381,8646,10011,11476,13041,14706,16471,18336,20503,22578,

%U 24753,27028,29403,31878,34453,37128,39903,42778,46056,49141,52326,55611

%N Triangular numbers with palindromic indices.

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

%F a(n) = A000217(A002113(n)).

%t Module[{nn=500,paldx},paldx=Table[If[PalindromeQ[n],1,0],{n,0,nn}];Pick[Accumulate[ Range[ 0,nn]],paldx,1]] (* _Harvey P. Dale_, Jun 11 2024 *)

%o (Python)

%o from itertools import chain, count, islice

%o def A089717_gen(): # generator of terms

%o return map(lambda n:n*(n+1)//2,chain((0,),chain.from_iterable(chain((int((s:=str(d))+s[-2::-1]) for d in range(10**l,10**(l+1))), (int((s:=str(d))+s[::-1]) for d in range(10**l,10**(l+1)))) for l in count(0))))

%o A089717_list = list(islice(A089717_gen(),20)) # _Chai Wah Wu_, Jun 23 2022

%Y Cf. A008509, A000217, A002113.

%K nonn,base

%O 1,3

%A _Giovanni Teofilatto_, Nov 24 2004

%E Definition corrected by Lambert.Klasen and David Wasserman, Oct 04 2005

%E More terms from _David Wasserman_ and _Klaus Brockhaus_, Oct 04 2005