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.

Showing 1-1 of 1 results.

A259937 Concatenation of the numbers from 1 to n with numbers from n down to 1.

Original entry on oeis.org

11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891010987654321, 12345678910111110987654321, 123456789101112121110987654321
Offset: 1

Views

Author

Keywords

Comments

For n < 700, only a(1) and a(10) are primes.

Examples

			a(1) = 11.
a(5) = 1234554321.
		

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Flatten /@ IntegerDigits /@ (#~Join~Reverse@ # & /@ Table[Range@ n, {n, 12}]) (* Michael De Vlieger, Jul 10 2015 *)
  • PARI
    a(n)=my(r="");for(i=0,n-1,r=concat(n-i,concat(r,n-i))); eval(r); \\ Anders Hellström, Aug 16 2015
    
  • Python
    from itertools import chain
    def A259937(n): return int(''.join(str(d) for d in chain(range(1,n+1),range(n,0,-1)))) # Chai Wah Wu, Dec 20 2021

Formula

a(n) = A007908(n) concatenated with A000422(n).
Showing 1-1 of 1 results.