A007908 Triangle of the gods: to get a(n), concatenate the decimal numbers 1,2,3,...,n.
1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011, 123456789101112, 12345678910111213, 1234567891011121314, 123456789101112131415, 12345678910111213141516, 1234567891011121314151617, 123456789101112131415161718
Offset: 1
References
- R. K. Guy, Unsolved Problems in Number Theory, Section A3, page 15, of 3rd edition, Springer, 2010.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..300 (first 100 terms from T. D. Noe)
- Great Smarandache PRPrime search, Current status of search for a prime in this sequence [Broken link? It appears that this search reached n=344869 without finding a prime, and was then abandoned. - _N. J. A. Sloane_, Apr 09 2018]
- Y. Guo and M. Le, Smarandache concatenated power decimals and their irrationality, Smarandache Notions Journal, Vol. 9, No. 1-2. 1998, 100-102.
- Brady Haran and N. J. A. Sloane, The Most Wanted Prime Number, Numberphile video (2021).
- Ernst W. Mayer and others, Expected number of primes in OEIS A007908, Mersenne Forum, initial posting Oct 08 2015.
- Mersenne Forum, Smarandache prime(s).
- Clifford Pickover, Triangle of the Gods.
- N. J. A. Sloane, Confessions of a Sequence Addict (AofA2017), slides of invited talk given at AofA 2017, Jun 19 2017, Princeton. Mentions this sequence.
- N. J. A. Sloane, Exciting Number Sequences (video of talk), Mar 05 2021.
- F. Smarandache, Only Problems, Not Solutions!, Xiquan Publ., Phoenix-Chicago, 1993.
- R. W. Stephan, Factors and primes in two Smarandache sequences, viXra:1005.0104, 2011.
- 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.
- Eric Weisstein's World of Mathematics, Smarandache Prime.
- Index entries for sequences related to Most Wanted Primes video
Crossrefs
See A057137 for another version.
If we concatenate 1 through n but leave out k, we get sequences A262571 (leave out 1) through A262582 (leave out 12), etc., and again we can ask for the smallest prime in each sequence. See A262300 for a summary of these results. Primes seem to exist if we search far enough. - N. J. A. Sloane, Sep 29 2015
Concatenation of first n numbers in other bases: 2: A047778, 3: A048435, 4: A048436, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: this sequence, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447. - Dylan Hamilton, Aug 11 2010
Entries that give the primes in sequences of this type: A089987, A262298, A262300, A262552, A262555.
For semiprimes see A046461.
See also A033307 (the Champernowne constant) and A176942 (the Champernowne primes). A262043 is a variant of the present sequence.
A002782 is an amusing cousin of this sequence.
Least prime factor: A075019.
Programs
-
Haskell
a007908 = read . concatMap show . enumFromTo 1 :: Integer -> Integer -- Reinhard Zumkeller, Dec 13 2012
-
Magma
[Seqint(Reverse(&cat[Reverse(Intseq(k)): k in [1..n]])): n in [1..17]]; // Bruno Berselli, May 27 2011
-
Maple
A055642 := proc(n) max(1, ilog10(n)+1) ; end: A007908 := proc(n) if n = 1 then 1; else A007908(n-1)*10^A055642(n)+n ; fi ; end: seq(A007908(n),n=1..12) ; # R. J. Mathar, May 31 2008 # second Maple program: a:= proc(n) a(n):= `if`(n=0, 0, parse(cat(a(n-1), n))) end: seq(a(n), n=1..22); # Alois P. Heinz, Jan 12 2021
-
Mathematica
Table[FromDigits[Flatten[IntegerDigits[Range[n]]]], {n, 20}] (* Alonso del Arte, Sep 19 2012 *) FoldList[#2 + #1 10^IntegerLength[#2] &, Range[20]] (* Eric W. Weisstein, Nov 06 2015 *) FromDigits /@ Flatten /@ IntegerDigits /@ Flatten /@ Rest[FoldList[List, {}, Range[20]]] (* Eric W. Weisstein, Nov 04 2015 *) FromDigits /@ Flatten /@ IntegerDigits /@ Rest[FoldList[Append, {}, Range[20]]] (* Eric W. Weisstein, Nov 04 2015 *)
-
Maxima
a[1]:1$ a[n]:=a[n-1]*10^floor(log(10*n)/log(10))+n$ makelist(a[n],n,1,17); /* Bruno Berselli, May 27 2011 */
-
PARI
a(n)=my(s="");for(k=1,n,s=Str(s,k));eval(s) \\ Charles R Greathouse IV, Sep 19 2012
-
PARI
A007908(n,a=0)={for(d=1,#Str(n),my(t=10^d);for(k=t\10,min(t-1,n),a=a*t+k));a} \\ M. F. Hasler, Sep 30 2015
-
Python
def a(n): return int("".join(map(str, range(1, n+1)))) print([a(n) for n in range(1, 18)]) # Michael S. Branicky, Jan 12 2021
-
Python
from functools import reduce def A007908(n): return reduce(lambda i,j:i*10**len(str(j))+j,range(1,n+1)) # Chai Wah Wu, Feb 27 2023
Formula
a(n) = n + a(n-1)*10^A055642(n). - R. J. Mathar, May 31 2008
Extensions
Name edited by N. J. A. Sloane, Dec 15 2019
Comments