login
A345124
a(n) is the smallest k such that f(k) is composite for all m-fold compositions f of the functions 6*x +- 1, 1 <= m <= n.
1
20, 50, 284, 1868, 47951, 6245927, 15932178151
OFFSET
1,1
COMMENTS
Proof that a(n) exists for all n: The numbers that are equal to f(k) for some m-fold composition f of the functions 6*x +- 1 can be written as 6^m*k +- c, where c is in the set C_m, defined by C_1 = {1} and C_{m+1} = {6*c +- 1 for c in C_m}. Choose a positive integer k_0 that is divisible by all numbers in C_m for 1 <= m <= n. Then 6^m*k_0 +- c is divisible by (and greater than) c, so it is composite if c > 1. (In fact, the largest number in C_m is A003464(m).) Since there are arbitrarily long prime gaps, we can choose a positive integer r such that 6*k_0*r +- 1 are both composite. With k = k_0*r, the numbers 6^m*k +- c will all be composite for c in C_m, 1 <= m <= n, as desired. - Pontus von Brömssen, Nov 01 2021
EXAMPLE
Formula for the twin composites by iteration n:
n=1: 6*k+-1.
n=2: 6*(6*k+-1)+-1.
n=3: 6*(6*(6*k+-1)+-1)+-1.
Term a(n) example for smallest number k for iteration n:
a(1)=20, 6*20-1=119, 6*20+1=121, all {119,121} are composite numbers.
a(2)=50, 6*50-1=299, 6*50+1=301, 6*(6*50-1)-1=1793, 6*(6*50-1)+1=1795, 6*(6*50+1)-1=1805, 6*(6*50+1)+1=1807, all {299,301,1793,1795,1805,1807} are composite numbers.
MATHEMATICA
a[n_] := Module[{k = 1}, While[!AllTrue[Flatten@ Rest@ NestList[Flatten@ Join[{6*# - 1, 6*# + 1}] &, k, n], CompositeQ], k++]; k]; Array[a, 5] (* Amiram Eldar, Oct 25 2021 *)
PROG
(Python)
from sympy import isprime
def A345124(n):
C = [[1]]
for i in range(n-1):
C.append(sum(([6*c-1, 6*c+1] for c in C[-1]), []))
k = 1
while 1:
k6 = 6*k
for i in range(n):
if any(isprime(k6-c) or isprime(k6+c) for c in C[i]):
break
k6 *= 6
else:
return k
k += 1 # Pontus von Brömssen, Nov 01 2021
CROSSREFS
Cf. A003464, A060461 (numbers k such that 6*k+-1 are twin composites).
Sequence in context: A228023 A241609 A331753 * A049390 A220040 A128905
KEYWORD
nonn,more
AUTHOR
Marc Morgenegg, Oct 06 2021
EXTENSIONS
More terms from Pontus von Brömssen, Oct 06 2021
Name edited by Pontus von Brömssen, Nov 01 2021
a(7) from Martin Ehrenstein, Nov 13 2021
STATUS
approved