VOOZH
about
URL: https://oeis.org/A386985
⇱ A386985 - OEIS
login
A386985
Smallest k > 0 such that the base-n number formed by concatenating k, k - 1, ..., 2, 1 (each written in base n) is prime, or -1 if no such k exists for the given n.
0
2, 2, 4, 2, 2, 373, 2, 2, 82, 2, 3
(
list
;
graph
;
refs
;
listen
;
history
;
text
;
internal format
)
OFFSET
2,1
COMMENTS
If a(13) != -1, then the corresponding prime must have more than 4178 decimal digits.
Sequence continues n=13..36: ?, 2, 2, 28, 362, 2, ?, 2, 2, 4, 2, 3, ?, 2, 5, 4, 2, 2, 37, 3, 2, 4, 2, 2.
The increasing-order analog begins 15, 2, ?. See
A048436
.
LINKS
Table of n, a(n) for n=2..12.
Mathematics Stack Exchange,
Concatenation of consecutive positive integers: Does a prime also exist in base 4 (as in bases 2, 3, 5, 6, 7, 8, 9,...)?
.
Robert G. Wilson v,
Letter to N. J. A. Sloane, Sep. 1992
.
EXAMPLE
a(3) = 2 since 21_(base-3) = 7_(base-10), which is prime.
PROG
(PARI) f(n, b) = my(p=1, L=1); sum(k=1, n, k*p*=L+(k==L&&!L*=b)); \\ adapted from
A000422
a(n) = my(k=1); while (!ispseudoprime(f(k, n)), k++); k; \\
Michel Marcus
, Aug 16 2025
CROSSREFS
Cf.
A000422
,
A048436
,
A281571
.
Sequence in context:
A113334
A127796
A131287
*
A102640
A332581
A328059
Adjacent sequences:
A386982
A386983
A386984
*
A386986
A386987
A386988
KEYWORD
nonn
,
base
,
hard
,
more
AUTHOR
Marco Ripà
, Aug 11 2025
STATUS
approved