OFFSET
1,2
COMMENTS
The first prime term in this sequence is a(82) (see A176024). - Artur Jasinski, Mar 30 2008
REFERENCES
F. Smarandache, "Properties of the Numbers", University of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ
LINKS
T. D. Noe, Table of n, a(n) for n = 1..150
R. W. Stephan, Factors and primes in two Smarandache sequences
Bertrand Teguia Tabuguia, Explicit formulas for concatenations of arithmetic progressions, arXiv:2201.07127 [math.CO], 2022.
Eric Weisstein's World of Mathematics, Consecutive Number Sequences
FORMULA
a(n+1) = (n+1)*10^len(a(n)) + a(n), where len(k) = number of digits in k.
a(n) = Sum_{k=1..n} k*10^(A058183(k) - (1+floor(log10(k)))). - Alexander Goebel, Mar 07 2020
From Serge Batalov, Dec 08 2021: (Start)
a(n) = ((n*9-1)*10^n+1)/9^2 for n < 10,
a(n) = ((n*99-1)*10^(2*n-19)-89)/99^2*10^10 + (8*10^10+1)/9^2 for 10 <= n < 100,
a(n) = ((n*999-1)*10^(3*n-299)-989)/999^2*10^191 + c2 for 10^2 <= n < 10^3,
a(n) = ((n*9999-1)*10^(4*n-3999)-9989)/9999^2*10^2892 + c3 for 10^3 <= n < 10^4,
a(n) = ((n*99999-1)*10^(5*n-49999)-99989)/99999^2*10^38893 + c4 for 10^4 <= n < 10^5,
a(n) = ((n*999999-1)*10^(6*n-599999)-999989)/999999^2*10^488894 + c5 for 10^5 <= n < 10^6,
where
c2 = (98*10^191 + 879*10^10 + 121)/99^2 = a(99),
c3 = (998*10^2701 - 989)/999^2*10^191 + c2 = a(999),
c4 = (9998*10^36001 - 9989)/9999^2*10^2892 + c3 = a(9999),
c5 = (99998*10^450001 - 99989)/99999^2*10^38893 + c4 = a(99999).
(End)
MAPLE
a[1]:= 1:
for n from 2 to 100 do
a[n]:= n*10^(1+ilog10(a[n-1])) + a[n-1]
od:
seq(a[n], n=1..100); # Robert Israel, Sep 05 2014
# second Maple program:
a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(n, a(n-1)))) end:
seq(a(n), n=1..22); # Alois P. Heinz, Jan 12 2021
MATHEMATICA
b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[PrependTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 30}]; b (* Artur Jasinski, Mar 30 2008 *)
Table[FromDigits[Flatten[IntegerDigits/@Range[n, 1, -1]]], {n, 20}] (* Harvey P. Dale, Jul 06 2019 *)
PROG
(PARI) a(n)=my(t=n); forstep(k=n-1, 1, -1, t=t*10^#Str(k)+k); t \\ Charles R Greathouse IV, Jul 15 2011
(PARI) A000422(n, p=1, L=1)=sum(k=1, n, k*p*=L+(k==L&&!L*=10)) \\ M. F. Hasler, Nov 02 2016
(Python)
def a(n): return int("".join(map(str, range(n, 0, -1))))
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Dec 08 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
R. Muller
EXTENSIONS
Edited by N. J. A. Sloane, Dec 03 2021
STATUS
approved