A168167
Numbers with d digits (d>0) which have at least 2d distinct primes as substrings.
Original entry on oeis.org
1373, 3137, 3797, 5237, 6173, 11317, 11373, 13733, 13739, 13797, 17331, 19739, 19973, 21137, 21317, 21373, 21379, 22397, 22937, 23117, 23137, 23173, 23371, 23373, 23719, 23797, 23971, 24373, 26173, 26317, 27193, 27197, 29173, 29537
Offset: 1
The least number with d digits to have 2d distinct prime substrings is a(1)=1373, with 4 digits and #{3, 7, 13, 37, 73, 137, 373, 1373} = 8.
-
filter:= proc(n) local i,j,count,d,S,x,y;
d:= ilog10(n)+1;
count:= 0; S:= {};
for i from 0 to d-1 do
x:= floor(n/10^i);
for j from i to d-1 do
y:= x mod 10^(j-i+1);
if not member(y,S) and isprime(y) then count:= count+1; S:= S union {y}; if count = 2*d then return true fi fi
od od;
false
end proc:
select(filter, [$10..10^5]); # Robert Israel, Nov 11 2020
-
{for( p=1, 1e6, #prime_substrings(p) >= #Str(p)*2 & print1(p", "))} /* see A168168 for prime_substrings() */
A168169
Primes with d digits (d>0) which have more than 2d distinct primes as substrings.
Original entry on oeis.org
23719, 31379, 52379, 113171, 113173, 113797, 123719, 153137, 179719, 199739, 211373, 213173, 229373, 231197, 231379, 233113, 233713, 236779, 237331, 237619, 237971, 241973, 259397, 291373, 313739, 317971, 327193, 337397, 343373, 353173
Offset: 1
The least number with d digits to have over 2d distinct prime substrings is the prime a(1)=23719, with 5 digits and #{2, 3, 7, 19, 23, 37, 71, 719, 2371, 3719, 23719} = 11.
-
filter:= proc(n) local i,j,count,d,S,x,y;
if not isprime(n) then return false fi;
d:= ilog10(n)+1;
count:= 0; S:= {};
for i from 0 to d-1 do
x:= floor(n/10^i);
for j from i to d-1 do
y:= x mod 10^(j-i+1);
if not member(y,S) and isprime(y) then count:= count+1; S:= S union {y}; if count > 2*d then return true fi fi
od od;
false
end proc:
select(filter, [seq(i,i=1..10^6,2)]); # Robert Israel, Nov 11 2020
-
{forprime( p=1, default(primelimit), #prime_substrings(p) > #Str(p)*2 & print1(p", "))} /* see A168168 for prime_substrings() */
A211683
Numbers > 100 such that all the substrings of length = 2 are primes.
Original entry on oeis.org
111, 113, 117, 119, 131, 137, 171, 173, 179, 197, 231, 237, 297, 311, 313, 317, 319, 371, 373, 379, 411, 413, 417, 419, 431, 437, 471, 473, 479, 531, 537, 597, 611, 613, 617
Offset: 1
a(2)=113, since all substrings of length = 2 are primes (11 and 13).
a(10)=197, since all substrings of length = 2 (19, 97) are primes.
Showing 1-3 of 3 results.
Comments