OFFSET
1,2
COMMENTS
The decision to use the expression 2*k*(digit) instead of k*(digit) is based on the fact that k*(odd) + 1 is never prime. By multiplying k*(digit) by 2, we ensure that any number, regardless of its digits, can appear in the sequence. Additionally, numbers containing the digit 0 are never terms, as 2*k*(0) + 1 is never prime.
When k is restricted to the smallest term with n distinct digits, only 7 terms exist (see A382198).
If the smallest term k is further restricted to a prime number p with n distinct digits, the conditions become significantly more restrictive (see A382127).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..3761 from Jakub Buczak)
EXAMPLE
63 is a term because both 2*63*6 + 1 and 2*63*3 + 1 are prime.
MAPLE
filter:= proc(n)
andmap(t -> isprime(2*n*t+1), convert(n, base, 10))
end proc:
select(filter, [$1..1000]); # Robert Israel, Nov 02 2025
MATHEMATICA
Select[Range[2500], AllTrue[2 * # * IntegerDigits[#] + 1, PrimeQ] &] (* Amiram Eldar, Mar 17 2025 *)
PROG
(PARI) isok(k) = my(d=Set(digits(k))); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0)); ); return(1); \\ Michel Marcus, Mar 17 2025
(Python)
from sympy import isprime
def ok(n): return all(isprime(2*n*d+1) for d in map(int, set(str(n))))
print([k for k in range(956) if ok(k)]) # Michael S. Branicky, Mar 17 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jakub Buczak, Mar 17 2025
STATUS
approved
