login
The smallest prime whose representation in base n contains the digit 0.
2

%I #14 Dec 01 2025 16:53:49

%S 2,3,17,5,37,7,67,83,101,11,149,13,197,227,257,17,331,19,401,443,487,

%T 23,577,631,677,733,787,29,907,31,1031,1091,1163,1229,1297,37,1447,

%U 1523,1601,41,1777,43,1949,2027,2129,47,2309,2411,2503,2609,2707,53,2917

%N The smallest prime whose representation in base n contains the digit 0.

%C If n is prime then a(n) = n, otherwise a(n) > n^2.

%C Such a prime always exists.

%H Paolo Xausa, <a href="/A390983/b390983.txt">Table of n, a(n) for n = 2..10000</a>

%t A390983[n_] := If[PrimeQ[n], n, NestWhile[NextPrime, NextPrime[n^2], FreeQ[IntegerDigits[#, n], 0] &]];

%t Array[A390983, 60, 2] (* _Paolo Xausa_, Dec 01 2025 *)

%o (PARI) a(n) = my(p=2); while (vecmin(digits(p, n)), p = nextprime(p+1)); p; \\ _Michel Marcus_, Nov 25 2025

%K nonn,base

%O 2,1

%A _Nicolas Bělohoubek_, Nov 25 2025