login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007942 Decimal concatenation of sequence (n, n-1, ..., 2, 1, 2, ..., n-1, n). 6
1, 212, 32123, 4321234, 543212345, 65432123456, 7654321234567, 876543212345678, 98765432123456789, 109876543212345678910, 1110987654321234567891011, 12111098765432123456789101112, 131211109876543212345678910111213, 1413121110987654321234567891011121314 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

For n <= 1530, only a(13) = 131211109876543212345678910111213 is prime. - XU Pingya, May 21 2017

LINKS

Michael S. Branicky, Table of n, a(n) for n = 1..202

F. Smarandache, Only Problems, Not Solutions!

FORMULA

a(n+1) = n*10^(floor(1+log_10(a(n))) + floor(1+log_10(n))) + a(n)*10^floor(1+log_10(n))+n, with a(1)=1. - Paolo P. Lava, Jun 04 2008

MAPLE

P:=proc(n) local a, b, i; a:=1; b:=0; print(a); for i from 1 by 1 to n do b:=a; a:=(i+1)*10^(2+floor(evalf(log10(b), 10))+floor(evalf(log10(i+1), 10)))+b*10^(1+floor(evalf(log10(i+1), 10)))+i+1; print(a); od; end: P(100); # Paolo P. Lava, Jun 04 2008

# second Maple program:

a:= n-> parse(cat(n-i$i=0..n-1, $2..n)):

seq(a(n), n=1..23); # Alois P. Heinz, Dec 19 2021

MATHEMATICA

Table[d = Flatten[IntegerDigits /@ Range@ n]; FromDigits@ Flatten[{Reverse@ d, Rest@ d}, 1], {n, 11}] (* Michael De Vlieger, Aug 20 2015 *)

PROG

(PARI) a(n) = s = ""; forstep (k=n, 1, -1, s = concat(s, k)); for (k=2, n, s = concat(s, k)); eval(s); \\ Michel Marcus, Aug 20 2015

(Python)

from itertools import count, islice

def agen(): # generator of terms

s = "1"

for n in count(2):

yield int(s)

s = str(n) + s + str(n)

print(list(islice(agen(), 14))) # Michael S. Branicky, Dec 09 2022

CROSSREFS

Sequence in context: A204299 A332121 A083962 * A210257 A239045 A262657

Adjacent sequences: A007939 A007940 A007941 * A007943 A007944 A007945

KEYWORD

nonn,base,easy

AUTHOR

R. Muller

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 1 17:37 EST 2023. Contains 359993 sequences. (Running on oeis4.)