|
|
A261138
|
|
The concatenation of 123456...n and the reverse of this number.
|
|
1
|
|
|
11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891001987654321, 12345678910111101987654321, 123456789101112211101987654321, 1234567891011121331211101987654321, 12345678910111213144131211101987654321
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Let R(n) denote the number obtained by formally reversing the digits of n, including any leading zeros that may appear; a(n) is the decimal concatenation of 1,2,...,n,R(n),R(n-1),...,R(3),R(2),R(1). - N. J. A. Sloane, Dec 01 2021
Has same start as A259937, but A259937 generates non-palindromic terms for n>9.
All terms are multiples of 11 (cf. A349805).
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n=10 we concatenate 1,2,3,...,10,01,9,8,...3,2,1 getting 1234567891001987654321.
|
|
MAPLE
|
with(StringTools);
myReverse := n -> Reverse(convert(n, string));
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], ""));
# second Maple program:
a:= n-> (s-> parse(cat(s, seq(s[-i], i=1..length(s)))))(cat("", $1..n)):
|
|
MATHEMATICA
|
Table[d = Flatten[IntegerDigits /@ Range@ n]; FromDigits@ Flatten[{d, Reverse@ d}], {n, 13}] (* Michael De Vlieger, Aug 20 2015 *)
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More than the usual number of terms are shown in order to distinguish this from several similar sequences.
|
|
STATUS
|
approved
|
|
|
|