A374376
Array read by downward antidiagonals: T(k,n) is the least number that has k prime factors (counted with multiplicity) and is the concatenation of n primes, or -1 if there is no such number.
Original entry on oeis.org
2, 23, -1, 223, 22, -1, 2237, 235, 27, -1, 22273, 2227, 222, 132, -1, 222323, 22223, 2222, 225, 32, -1, 2222273, 222223, 22222, 2223, 252, 729, -1, 22222223, 2222557, 222227, 22225, 2322, 352, 192, -1, 222222227, 22222237, 2222222, 222225, 22232, 2232, 2352, 2112, -1, 2222222377, 222222223
Offset: 1
Array starts
2 23 223 2237 22273 ...
-1 22 235 2227 22223 ...
-1 27 222 2222 22222 ...
-1 132 225 2223 22225 ...
-1 32 252 2322 22232 ...
A(4,3) = 225 because 225 = 3^2 * 5^2 is the product of 4 primes (with multiplicity) and is the concatenation of the 3 primes 2, 2 and 5, and is the least number that works.
-
PD[1]:= [2,3,5,7]:
for i from 2 to 7 do PD[i]:= select(isprime,[seq(i,i=10^(i-1)+1..10^i-1,2)]) od:
dcat:= proc(a,b) 10^(ilog10(b)+1)*a+b end proc:
cp:= proc(m,n) option remember; local d,p,x,R;
if n = 1 then return PD[m] fi;
R:= {};
for d from 1 to m-n+1 do
R:= R union {seq(seq(dcat(p,x),p=PD[d]),x=procname(m-d,n-1))}
od;
R
end proc:
F:= proc(n,N)
local V,count,d,x,v;
if n = 1 then return <2,(-1)$(N-1)> fi;
V:= Vector(N); count:= 0;
for d from n while count < N do
for x in sort(convert(cp(d,n),list)) while count < N do
v:= numtheory:-bigomega(x);
if v <= N and V[v] = 0 then
V[v]:= x; count:= count+1;
fi
od od:
V;
end proc:
N:= 10: M:= Matrix(N,N):
for i from 1 to N do
V:= F(i,N+1-i);
M[i,1..N+1-i]:= V;
od:
[seq(seq(M[t-i,i],i=1..t-1),t=2..N+1)];
A384403
a(n) is the smallest number with n digits, all of which are prime, and n prime factors, counted with multiplicity, or -1 if there is no such number.
Original entry on oeis.org
2, 22, 222, 2223, 22232, 222222, 2222325, 22222272, 222225552, 2222223255, 22222335232, 222222327525, 2222222372352, 22222222575552, 222222223327232, 2222222225252352, 22222222223327232, 222222222272535552, 2222222222225252352, 22222222222327775232, 222222222222737375232, 2222222222227572375552
Offset: 1
a(4) = 2223 because the four digits 2,2,2,3 are prime and 2223 = 3^2 * 13 * 19 has 4 prime factors, counted with multiplicity.
-
PD:= [2,3,5,7]:
f:= proc(n) local x,L,t,i;
for x from 4^n to 2*4^n-1 do
L:= convert(x,base,4);
t:= add(PD[L[i]+1]*10^(i-1),i=1..n);
if numtheory:-bigomega(t) = n then return t fi
od;
-1
end proc;
map(f, [$1..25]);
A384726
a(n) is the least number that is both the product of n distinct primes and the concatenation of n distinct primes.
Original entry on oeis.org
2, 35, 273, 11235, 237615, 11237835, 1123317195, 111371237835, 11132343837615, 1113172923477615, 111317233377372295, 11131723677292413195, 1113172377671953734135, 111317192375336174123715
Offset: 1
a(4) = 11235 is a term because 11235 is the product of four distinct primes 3, 5, 7, 107 and the concatenation of four distinct primes 11, 2, 3, 5, and no smaller number works.
-
cdp:= proc(x, n, S)
local i,y;
if n = 1 then return (not(member(x,S)) and isprime(x)) fi;
for i from 1 to ilog10(x)+2-n do
y:= x mod 10^i;
if member(y,S) or not isprime(y) then next fi;
if procname((x-y)/10^i, n-1, S union {y}) then return true fi;
od;
false
end proc:
f:= proc(n) uses priqueue; local pq, t, p, x, i, L, v, Lp;
initialize(pq);
L:= [seq(ithprime(i), i=2..n+1)];
v:= convert(L, `*`);
insert([-v, L], pq);
do
t:= extract(pq);
x:= -t[1];
if cdp(x,n,{}) then return x fi;
L:= t[2];
p:= nextprime(L[-1]);
for i from n to 1 by -1 do
if i < n and L[i] <> prevprime(L[i+1]) then break fi;
Lp:= [op(L[1..i-1]), op(L[i+1..n]), p];
insert([-convert(Lp, `*`), Lp], pq)
od od;
end proc:
f(1):= 2:
map(f, [$1..9]);
Showing 1-3 of 3 results.
Comments