A261138 The concatenation of 123456...n and the reverse of this number.
11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891001987654321, 12345678910111101987654321, 123456789101112211101987654321, 1234567891011121331211101987654321, 12345678910111213144131211101987654321
Offset: 1
Examples
For n=10 we concatenate 1,2,3,...,10,01,9,8,...3,2,1 getting 1234567891001987654321.
Programs
-
Maple
with(StringTools); myReverse := n -> Reverse(convert(n,string)); A349804:=proc(n) local i,L,R; L:=""; R:=""; for i from n to 1 by -1 do L:=Join( [convert(i,string), L],""); R:=Join( [R, myReverse(convert(i,string))],""); od: parse(Join([L,R],"")); end proc; # N. J. A. Sloane, Dec 01 2021 # second Maple program: a:= n-> (s-> parse(cat(s, seq(s[-i], i=1..length(s)))))(cat("", $1..n)): seq(a(n), n=1..14); # Alois P. Heinz, Dec 01 2021
-
Mathematica
Table[d = Flatten[IntegerDigits /@ Range@ n]; FromDigits@ Flatten[{d, Reverse@ d}], {n, 13}] (* Michael De Vlieger, Aug 20 2015 *)
-
Python
def A349804(n): return int((lambda x: x+x[::-1])(''.join(str(d) for d in range(1,n+1)))) # Chai Wah Wu, Dec 01 2021
Extensions
More than the usual number of terms are shown in order to distinguish this from several similar sequences.
Edited by N. J. A. Sloane, Dec 11 2021
Comments