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.
%I A007908 #277 Feb 16 2025 08:32:31 %S A007908 1,12,123,1234,12345,123456,1234567,12345678,123456789,12345678910, %T A007908 1234567891011,123456789101112,12345678910111213,1234567891011121314, %U A007908 123456789101112131415,12345678910111213141516,1234567891011121314151617,123456789101112131415161718 %N A007908 Triangle of the gods: to get a(n), concatenate the decimal numbers 1,2,3,...,n. %C A007908 For the name "triangle of the gods" see Pickover link. - _N. J. A. Sloane_, Dec 15 2019 %C A007908 Number of digits: A058183(n) = A055642(a(n)); sums of digits: A037123(n) = A007953(a(n)). - _Reinhard Zumkeller_, Aug 10 2010 %C A007908 Charles Nicol and John Selfridge ask if there are infinitely many primes in this sequence - see the Guy reference. - _Charles R Greathouse IV_, Dec 14 2011 %C A007908 Stephan finds no primes in the first 839 terms. I checked that there are no primes in the first 5000 terms. Heuristically there are infinitely many, about 0.5 log log n through the n-th term. - _Charles R Greathouse IV_, Sep 19 2012 [Expanded search to 20000 without finding any primes. - _Charles R Greathouse IV_, Apr 17 2014] [Independent search extended to 64000 terms without finding any primes. - _Dana Jacobsen_, Apr 25 2014] %C A007908 Elementary congruence arguments show that primes can occur only at indices congruent to 1, 7, 13, or 19 mod 30. - _Roderick MacPhee_, Oct 05 2015 %C A007908 A note on heuristics: I wrote a quick program to count primes in sequences which are like A007908 but start at k instead of 1. I ran this for k = 1 to 100 and counted the primes up to 1000 (1000 possibilities for k = 1, 999 for k = 2, etc. up to 901 for k = 100). I then compared this to the expected count which is 0 if the number N is divisible by 2, 3, or 5 and 15/(4 log N) otherwise. (If N < 43 I counted the number as 1 instead.) k = 1 has 1.788 expected primes but only 0 actual (of course). k = 2 has 2.268 expected but 4 actual (see A262571, A089987). In total the expectation is 111.07 and the actual count is 110, well within the expected error of +/- 10.5. - _Charles R Greathouse IV_, Sep 28 2015 %C A007908 Early bird numbers for n > 1: a(2) = A116700(1) = 12; a(3) = A116700(52) = 123; a(4) = A116700(725) = 1234; a(5) = A116700(8074) = 12345; a(6) = A116700(85846) = 123456. - _Reinhard Zumkeller_, Dec 13 2012 %C A007908 For n < 10^6, a(n)/A000217(n) is an integer for n = 1, 2, and 5. The integers are 1, 4, and 823 (a prime), respectively. - _Derek Orr_, Sep 04 2014; _Max Alekseyev_, Sep 30 2015 %C A007908 In order to be a prime, a(n) must end in a digit 1, 3, 7 or 9, so only 4 among 10 consecutive values can be prime. (But a(64000) already has A058183(64000) > 300000 digits.) Also, a(64001) and a(64011) and more generally a(64001+10k) is divisible by 3 unless k == 2 (mod 3), but for k = 2, 5, 8, ... 23 these are divisible by small primes < 999. a(64261) is the first serious candidate in this subsequence. - _M. F. Hasler_, Sep 30 2015 %C A007908 There are no primes in the first 10^5 terms. - _Max Alekseyev_, Oct 03 2015; Oct 11 2015 %C A007908 There are no primes in the first 200000 terms. - _Serge Batalov_, Oct 24 2015 %C A007908 There is a distributed project for continued search, using PRPNet/PFGW software; see the Mersenne Forum link below. - _Serge Batalov_, Oct 18 2015 %C A007908 It appears that the Mersenne Forum search reached n = 344869 without finding a prime, and was then abandoned. It would be nice if someone could recover the final version of that link from the Wayback machine - the Great Smarandache PRPrime search, http://99.121.249.54:1200 - so that we have a record of how far they searched. - _N. J. A. Sloane_, Apr 09 2018 %C A007908 The web page https://www.mersenneforum.org/showthread.php?t=20527&page=9 has a comment from Serge Balatov that seems to say that the search reached 10^6 without finding a prime. It would be nice to have this confirmed, and to get more details about how it was done. - _N. J. A. Sloane_, Dec 15 2019 %C A007908 The expected number of primes among the first million terms is about 0.6. - _Ernst W. Mayer_, Oct 09 2015 %C A007908 A few semiprimes exist among the early terms, but then become scarce: see A046461. For the base-2 analog of this sequence (A047778), there is a 15-decimal digit prime, but _Hans Havermann_ has shown that the second prime would have more than 91000 digits. - _N. J. A. Sloane_, Oct 08 2015 %D A007908 R. K. Guy, Unsolved Problems in Number Theory, Section A3, page 15, of 3rd edition, Springer, 2010. %H A007908 N. J. A. Sloane, <a href="/A007908/b007908.txt">Table of n, a(n) for n = 1..300</a> (first 100 terms from T. D. Noe) %H A007908 Great Smarandache PRPrime search, <a href="http://99.121.249.54:1200">Current status of search for a prime in this sequence</a> [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] %H A007908 Y. Guo and M. Le, <a href="http://vixra.org/abs/1403.0549">Smarandache concatenated power decimals and their irrationality</a>, Smarandache Notions Journal, Vol. 9, No. 1-2. 1998, 100-102. %H A007908 Brady Haran and N. J. A. Sloane, <a href="https://www.youtube.com/watch?v=vKlVNFOHJ9I">The Most Wanted Prime Number</a>, Numberphile video (2021). %H A007908 Ernst W. Mayer and others, <a href="https://www.mersenneforum.org/showthread.php?t=20535&highlight=A007908">Expected number of primes in OEIS A007908</a>, Mersenne Forum, initial posting Oct 08 2015. %H A007908 Mersenne Forum, <a href="http://mersenneforum.org/showthread.php?t=20527">Smarandache prime(s)</a>. %H A007908 Clifford Pickover, <a href="http://sprott.physics.wisc.edu/Pickover/trianglegod.htm">Triangle of the Gods</a>. %H A007908 N. J. A. Sloane, <a href="/A195264/a195264.pdf">Confessions of a Sequence Addict (AofA2017)</a>, slides of invited talk given at AofA 2017, Jun 19 2017, Princeton. Mentions this sequence. %H A007908 N. J. A. Sloane, <a href="https://www.youtube.com/watch?v=9ogbsh8KuEM">Exciting Number Sequences</a> (video of talk), Mar 05 2021. %H A007908 F. Smarandache, <a href="http://fs.gallup.unm.edu/OPNS.pdf">Only Problems, Not Solutions!</a>, Xiquan Publ., Phoenix-Chicago, 1993. %H A007908 R. W. Stephan, <a href="http://vixra.org/abs/1005.0104">Factors and primes in two Smarandache sequences</a>, viXra:1005.0104, 2011. %H A007908 Bertrand Teguia Tabuguia, <a href="https://arxiv.org/abs/2201.07127">Explicit formulas for concatenations of arithmetic progressions</a>, arXiv:2201.07127 [math.CO], 2022. %H A007908 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ConsecutiveNumberSequences.html">Consecutive Number Sequences</a>. %H A007908 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SmarandachePrime.html">Smarandache Prime</a>. %H A007908 <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a> %F A007908 a(n) = n + a(n-1)*10^A055642(n). - _R. J. Mathar_, May 31 2008 %F A007908 a(n) = floor(C*10^(A058183(n))) with C = A033307. - _José de Jesús Camacho Medina_, Aug 19 2015 %p A007908 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 %p A007908 # second Maple program: %p A007908 a:= proc(n) a(n):= `if`(n=0, 0, parse(cat(a(n-1), n))) end: %p A007908 seq(a(n), n=1..22); # _Alois P. Heinz_, Jan 12 2021 %t A007908 Table[FromDigits[Flatten[IntegerDigits[Range[n]]]], {n, 20}] (* _Alonso del Arte_, Sep 19 2012 *) %t A007908 FoldList[#2 + #1 10^IntegerLength[#2] &, Range[20]] (* _Eric W. Weisstein_, Nov 06 2015 *) %t A007908 FromDigits /@ Flatten /@ IntegerDigits /@ Flatten /@ Rest[FoldList[List, {}, Range[20]]] (* _Eric W. Weisstein_, Nov 04 2015 *) %t A007908 FromDigits /@ Flatten /@ IntegerDigits /@ Rest[FoldList[Append, {}, Range[20]]] (* _Eric W. Weisstein_, Nov 04 2015 *) %o A007908 (PARI) a(n)=my(s="");for(k=1,n,s=Str(s,k));eval(s) \\ _Charles R Greathouse IV_, Sep 19 2012 %o A007908 (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 %o A007908 (Magma) [Seqint(Reverse(&cat[Reverse(Intseq(k)): k in [1..n]])): n in [1..17]]; // _Bruno Berselli_, May 27 2011 %o A007908 (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 */ %o A007908 (Haskell) %o A007908 a007908 = read . concatMap show . enumFromTo 1 :: Integer -> Integer %o A007908 -- _Reinhard Zumkeller_, Dec 13 2012 %o A007908 (Python) %o A007908 def a(n): return int("".join(map(str, range(1, n+1)))) %o A007908 print([a(n) for n in range(1, 18)]) # _Michael S. Branicky_, Jan 12 2021 %o A007908 (Python) %o A007908 from functools import reduce %o A007908 def A007908(n): return reduce(lambda i,j:i*10**len(str(j))+j,range(1,n+1)) # _Chai Wah Wu_, Feb 27 2023 %Y A007908 See A057137 for another version. %Y A007908 Cf. A033307, A053064, A000422 (left concatenations) %Y A007908 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 %Y A007908 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 %Y A007908 Entries that give the primes in sequences of this type: A089987, A262298, A262300, A262552, A262555. %Y A007908 For semiprimes see A046461. %Y A007908 See also A007376 (the almost-natural numbers), A071620 (primes in that sequence). %Y A007908 See also A033307 (the Champernowne constant) and A176942 (the Champernowne primes). A262043 is a variant of the present sequence. %Y A007908 A002782 is an amusing cousin of this sequence. %Y A007908 Least prime factor: A075019. %K A007908 nonn,base,easy %O A007908 1,2 %A A007908 R. Muller %E A007908 Name edited by _N. J. A. Sloane_, Dec 15 2019