OFFSET
2,1
COMMENTS
Conjecture: a(n) <= A371641(n) for n >= 2.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 2..10000
FORMULA
If p is prime, then a(p*(m+2)-1) <= p^2 for all m >= 0.
If n+1 is composite, then a(n) <= q^2, where q = A020639(n+1) is the smallest prime factor of n+1. This implies that if n > 2 is odd, then a(n) = A371641(n) = 4.
The first few terms n where n+1 is composite and a(n) < A020639(n+1)^2 are a(288) = 70, a(298) = 42, a(340) = 42, a(360) = 182, ...
If n is even, then a(n) >= 9. This is true as it is easy to verify that a(n) cannot be equal to 4, 6 or 8 in this case.
Suppose n>2 is even. 2 concatenated twice in base n is 2(n+1) which is not divisible by 4.
Next, 3 concatenated by 2 is 3*n+2 which is not divisible by 6. Finally 2 concatenated 3 times is 2(n^3-1)/(n-1) which is not divisible by 8 since n^3-1 is odd.
This implies that if n = 6*k+2 for some k > 0, then a(n) = A371641(n) = 9.
EXAMPLE
a(2) = 42 since 42 = 7*3*2 = 111_2 * 11_2 * 10 _2 and 42 divides 126 = 1111110_2.
a(10) = 378 since 278 = 7*3*3*3*2 and 278 divides 73332.
PROG
(Python)
from itertools import count
from sympy import factorint, integer_log
def A371699(n):
for m in count(4):
f = factorint(m)
if sum(f.values()) > 1:
c = 0
for p in sorted(f, reverse=True):
a = pow(n, integer_log(p, n)[0]+1, m)
for _ in range(f[p]):
c = (c*a+p)%m
if not c:
return m
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Apr 12 2024
STATUS
approved