A261570 Concatenation of the palindromic numbers (A002113) in increasing order up to the n-th term and then in decreasing order.
1, 121, 12321, 1234321, 123454321, 12345654321, 1234567654321, 123456787654321, 12345678987654321, 12345678911987654321, 123456789112211987654321, 1234567891122332211987654321, 12345678911223344332211987654321, 123456789112233445544332211987654321
Offset: 1
Examples
a(4) is the concatenation of 1, 2, 3 and 4, and then 3, 2 and 1 which results in 1234321.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..108
Programs
-
Mathematica
palQ[n_] := Reverse[idn = IntegerDigits@ n] == idn; s = Select[ Range @111, palQ]; f[n_] := FromDigits@ Flatten[ IntegerDigits@# & /@ Join[Take[s, n], Reverse@ Take[s, n - 1]]]; a = Array[f, 14]
-
PARI
A002113(n)=if(n>9,(n-=9)*10+if(n>9,n\10,n),n)/* This "poor man's" version is valid only for n<109 */ A261570(n,S=A002113(n))={while(n--,S=Str(A002113(n),S,A002113(n)));eval(S)} \\ M. F. Hasler, Aug 29 2015
Comments