login
Primes which are not the concatenation of smaller primes (in base 10 and allowing leading 0's).
1

%I #23 Oct 16 2021 03:32:16

%S 2,3,5,7,11,13,17,19,29,31,41,43,47,59,61,67,71,79,83,89,97,101,103,

%T 107,109,127,131,139,149,151,157,163,167,179,181,191,199,239,251,263,

%U 269,281,349,401,409,419,421,431,439,443,449,457,461,463,467,479,487,491,499

%N Primes which are not the concatenation of smaller primes (in base 10 and allowing leading 0's).

%C This is the sequence of numbers that are neither a product of smaller primes nor a concatenation of smaller primes (in base 10).

%C This sequence differs from A238647. The prime 227 is in A238647 but not in this sequence for it is the concatenation of primes 2, 2, 7 (in base 10).

%C Conjecture. If p > 7 is a prime, then there exists a base b such that p in base b is the concatenation of smaller primes in base b.

%e The prime 127 is in the sequence because the only expressions of 127 as concatenation of smaller numbers are 1 U 2 U 7, 1 U 27, and 12 U 7 (in base 10) but 1 and 12 are not primes.

%e The prime 271 is not in the sequence because it is the concatenation of primes 2 and 71 (in base 10).

%e The prime 307 is not in the sequence because it is the concatenation of primes 3 and 07 (in base 10).

%t Select[Prime@Range@100,Union[And@@@PrimeQ[FromDigits/@#&/@Union@Select[Flatten[Permutations/@Subsets[Most@Rest@Subsequences[d=IntegerDigits@#]],1],Flatten@#==d&]]]=={False}||Length@d==1&] (* _Giorgos Kalogeropoulos_, Oct 15 2021 *)

%o (Python)

%o from sympy import isprime, primerange

%o def cond(n): # n is not a concatenation of smaller primes

%o if n%10 in {4, 6, 8}: return True

%o d = str(n)

%o for i in range(1, len(d)):

%o if isprime(int(d[:i])):

%o if isprime(int(d[i:])) or not cond(int(d[i:])):

%o return False

%o return True

%o def aupto(lim): return [p for p in primerange(2, lim+1) if cond(p)]

%o print(aupto(490)) # _Michael S. Branicky_, Oct 15 2021

%Y Cf. A141033, A141409, A238647, A342244, A348358.

%K easy,nonn,base

%O 1,1

%A _M. Farrokhi D. G._, Oct 14 2021