A382179 Numbers k such that for each digit of k, 2*k*(digit) + 1 is prime.
1, 3, 6, 9, 11, 14, 15, 22, 24, 25, 27, 28, 33, 44, 54, 63, 75, 78, 81, 88, 99, 111, 119, 131, 141, 153, 168, 173, 219, 249, 252, 255, 279, 282, 322, 325, 333, 357, 363, 414, 441, 459, 474, 491, 538, 553, 558, 565, 611, 666, 674, 699, 794, 797, 828, 831, 832, 858, 895, 924, 947, 955
Offset: 1
Examples
63 is a term because 2*63*6 + 1 and 2*63*3 + 1 are both prime.
Links
- Jakub Buczak, Table of n, a(n) for n = 1..4000
Programs
-
Mathematica
Select[Range[2500], AllTrue[2 * # * IntegerDigits[#] + 1, PrimeQ] &] (* Amiram Eldar, Mar 17 2025 *)
-
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
Comments