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
A palindromic version of A173426.
All terms are multiples of 11 (cf. A349805).
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));
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 *)
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
Umut Uludag, Aug 10 2015
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
STATUS
approved