A331116 Inserting a digit '1' between the first two adjacent digits of k, then inserting a digit '2' between the two following adjacent digits of k, ..., then inserting the integer '10' between the tenth and the eleventh digits of k, ... produces a prime number.
13, 21, 31, 33, 37, 49, 63, 67, 69, 79, 81, 91, 99, 107, 131, 139, 143, 157, 161, 181, 187, 193, 197, 203, 211, 221, 227, 233, 251, 253, 259, 277, 281, 299, 311, 313, 323, 331, 337, 367, 371, 373, 377, 379, 403, 421, 427, 451, 461, 467, 479
Offset: 1
Examples
281 gives 2(1)8(2)1 = 21821 that is prime, hence 281 is a term. 1027 gives 1(1)0(2)2(3)7 = 1102237 that is prime, hence 1027 is another term.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
seqQ[n_] := PrimeQ @ FromDigits @ Flatten @ IntegerDigits @ Riffle[(d = IntegerDigits[n]), Range[Length[d] - 1]]; Select[Range[10,480], seqQ] (* Amiram Eldar, Jan 10 2020 *)
-
Python
from sympy import isprime def ok(n): if n < 10: return False s = str(n) shuffle = list(map(str, ((i+1)//2 for i in range(2*len(s)-1)))) shuffle[0::2] = [s[i] for i in range(len(s))] return isprime(int("".join(shuffle))) print(list(filter(ok, range(480)))) # Michael S. Branicky, Jul 18 2021
Comments