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 A360502 #40 Apr 19 2023 11:31:44 %S A360502 1,12,1210,121011,12101112,1210111220,121011122021,12101112202122, %T A360502 12101112202122100,12101112202122100101,12101112202122100101102, %U A360502 12101112202122100101102110,12101112202122100101102110111,12101112202122100101102110111112,12101112202122100101102110111112120 %N A360502 Concatenate the ternary strings for 1,2,...,n. %C A360502 If the terms are read as ternary strings and converted to base 10, we get A048435. For example, a(2) = 12_3 = 5_10, which is A048435(2). This is a prime, and gives the first term of A360503. %C A360502 If the terms are read as decimal numbers, which of them are primes? 12101112202122100101102110111, for example, is not a prime, since it is 37*327057086543840543273030003. %C A360502 When read as decimal numbers, the first prime is a(7315), with 56003 digits. - _Michael S. Branicky_, Apr 18 2023 %H A360502 Winston de Greef, <a href="/A360502/b360502.txt">Table of n, a(n) for n = 1..222</a> %H A360502 <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a> %e A360502 a(4): concatenate 1, 2, 10, 11, getting 121011. %p A360502 a:= proc(n) option remember; `if`(n=0, 0, (l-> parse(cat( %p A360502 a(n-1), seq(l[-i], i=1..nops(l)))))(convert(n, base, 3))) %p A360502 end: %p A360502 seq(a(n), n=1..15); # _Alois P. Heinz_, Feb 17 2023 %t A360502 nn = 15; s = IntegerDigits[Range[nn], 3]; Array[FromDigits[Join @@ s[[1 ;; #]]] &, nn] (* _Michael De Vlieger_, Apr 19 2023 *) %o A360502 (Python) %o A360502 from sympy.ntheory import digits %o A360502 def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(1, n+1))) %o A360502 print([a(n) for n in range(1, 16)]) # _Michael S. Branicky_, Feb 18 2023 %o A360502 (Python) # faster version for initial segment of sequence %o A360502 from sympy.ntheory import digits %o A360502 from itertools import count, islice %o A360502 def agen(s=""): yield from (int(s:=s+"".join(map(str, digits(n, 3)[1:]))) for n in count(1)) %o A360502 print(list(islice(agen(), 15))) # _Michael S. Branicky_, Feb 18 2023 %Y A360502 Cf. A007089, A036954, A360503, A360504. %Y A360502 This is the ternary analog of A007908. %K A360502 nonn,base %O A360502 1,2 %A A360502 _N. J. A. Sloane_, Feb 16 2023