login
Numbers k such that, in base 4, the greatest prime less than 4^k and the least prime greater than 4^k have no common digit.
0

%I #43 May 19 2023 04:18:49

%S 1,4,28,83,1816

%N Numbers k such that, in base 4, the greatest prime less than 4^k and the least prime greater than 4^k have no common digit.

%C In base 4 all consecutive primes with no common digit are of this form, except for 2 and 3.

%C It is unknown whether this sequence is infinite.

%C Base 2 and base 3 have no such primes.

%H Mathematics StackExchange, <a href="https://math.stackexchange.com/questions/4649148/are-there-an-infinity-of-disjoint-consecutive-primes">Are there an infinity of disjoint consecutive primes?</a>

%e k=4 is a term: the consecutive primes are 251 and 257. In base 4 their representations are 3323 and 10001, which have no common digit.

%t Select[Range[100], ! IntersectingQ @@ IntegerDigits[NextPrime[4^#, {-1, 1}], 4] &] (* _Amiram Eldar_, Mar 03 2023 *)

%o (PARI) isok(k) = #setintersect(Set(digits(precprime(4^k), 4)), Set(digits(nextprime(4^k), 4))) == 0; \\ _Michel Marcus_, Mar 03 2023

%o (Python)

%o from sympy.ntheory import digits, nextprime, prevprime

%o def ok(n):

%o p, q = prevprime(4**n), nextprime(4**n)

%o return set(digits(p, 4)[1:]) & set(digits(q, 4)[1:]) == set()

%o print([k for k in range(1, 99) if ok(k)]) # _Michael S. Branicky_, Mar 03 2023

%Y Cf. A104082, A104089, A068802, A156981.

%K nonn,base,more

%O 1,2

%A _Lewis Baxter_, Mar 02 2023