cp's OEIS Frontend

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.

A362429 Smallest k such that the concatenation of the numbers 123...k in base n is prime when interpreted as a decimal number, or -1 if no such prime exists.

This page as a plain text file.
%I A362429 #33 Sep 16 2024 12:38:54
%S A362429 -1,231,7315,3241,6,12891,22,227,127
%N A362429 Smallest k such that the concatenation of the numbers 123...k in base n is prime when interpreted as a decimal number, or -1 if no such prime exists.
%C A362429 The sequence can be extended to bases larger than 10 by concatenating the decimal equivalents of digits.
%C A362429 a(1) is -1 since no such primes are possible (the sequence in question is A362118). Proof. The number of ones in the resulting repunit is triangular and per A000217, 3 is the only prime triangular number, and per A004023, prime repunits must have prime indices.
%C A362429 If it exists, a(10) would be the index of the first prime in A007908. See A007908 for the latest information about the search for this prime.
%C A362429 a(10), ..., a(14) are respectively ?, 144, 307, ?, 25.
%C A362429 a(10) and a(13) are presently unknown. a(13) > 10000 if it is not -1.
%e A362429 a(5) is 6: 12341011 (concatenate 1 though 6 in base 5) is a prime when interpreted as a decimal number.
%o A362429 (Python)
%o A362429 from gmpy2 import is_prime
%o A362429 from sympy.ntheory import digits
%o A362429 from itertools import count, islice
%o A362429 def c(base, s=""):
%o A362429     if base == 1: yield from (s:=s+"1"*n for n in count(1))
%o A362429     else:
%o A362429         yield from (s:=s+"".join(map(str, digits(n, base)[1:])) for n in count(1))
%o A362429 def a(n):
%o A362429     if n == 1: return -1
%o A362429     return next(k for k, t in enumerate(c(n), 1) if is_prime(int(t)))
%Y A362429 Sequences of concatenations: A362118 (base 1), A058935 (base 2), A360502 (base 3), A117640 (base 4), A362117 (base 5), A362119 (base 6), A007908 (base 10).
%Y A362429 Cf. A376221.
%K A362429 sign,base,more
%O A362429 1,2
%A A362429 _Michael S. Branicky_ and _N. J. A. Sloane_, Apr 19 2023