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.

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.

This page as a plain text file.
%I A345124 #77 Nov 25 2021 12:35:25
%S A345124 20,50,284,1868,47951,6245927,15932178151
%N 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.
%C A345124 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
%e A345124 Formula for the twin composites by iteration n:
%e A345124 n=1: 6*k+-1.
%e A345124 n=2: 6*(6*k+-1)+-1.
%e A345124 n=3: 6*(6*(6*k+-1)+-1)+-1.
%e A345124 Term a(n) example for smallest number k for iteration n:
%e A345124 a(1)=20, 6*20-1=119, 6*20+1=121, all {119,121} are composite numbers.
%e A345124 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.
%t A345124 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 *)
%o A345124 (Python)
%o A345124 from sympy import isprime
%o A345124 def A345124(n):
%o A345124     C = [[1]]
%o A345124     for i in range(n-1):
%o A345124         C.append(sum(([6*c-1,6*c+1] for c in C[-1]),[]))
%o A345124     k = 1
%o A345124     while 1:
%o A345124         k6 = 6*k
%o A345124         for i in range(n):
%o A345124             if any(isprime(k6-c) or isprime(k6+c) for c in C[i]):
%o A345124                 break
%o A345124             k6 *= 6
%o A345124         else:
%o A345124             return k
%o A345124         k += 1 # _Pontus von Brömssen_, Nov 01 2021
%Y A345124 Cf. A003464, A060461 (numbers k such that 6*k+-1 are twin composites).
%K A345124 nonn,more
%O A345124 1,1
%A A345124 _Marc Morgenegg_, Oct 06 2021
%E A345124 More terms from _Pontus von Brömssen_, Oct 06 2021
%E A345124 Name edited by _Pontus von Brömssen_, Nov 01 2021
%E A345124 a(7) from _Martin Ehrenstein_, Nov 13 2021