cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A261138 The concatenation of 123456...n and the reverse of this number.

Original entry on oeis.org

11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891001987654321, 12345678910111101987654321, 123456789101112211101987654321, 1234567891011121331211101987654321, 12345678910111213144131211101987654321
Offset: 1

Views

Author

Umut Uludag, Aug 10 2015

Keywords

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.
Has same start as A259937, but A259937 generates non-palindromic terms for n>9.
All terms are multiples of 11 (cf. A349805).

Examples

			For n=10 we concatenate 1,2,3,...,10,01,9,8,...3,2,1 getting 1234567891001987654321.
		

Crossrefs

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

Formula

a(n) = concatenate( A007908(n), A138793(n) retaining leading zeros).

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