%I #26 Jul 16 2024 15:57:56
%S 2,23,-1,223,22,-1,2237,235,27,-1,22273,2227,222,132,-1,222323,22223,
%T 2222,225,32,-1,2222273,222223,22222,2223,252,729,-1,22222223,2222557,
%U 222227,22225,2322,352,192,-1,222222227,22222237,2222222,222225,22232,2232,2352,2112,-1,2222222377,222222223
%N 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.
%D T(k,1) = -1 for k > 1.
%e Array starts
%e 2 23 223 2237 22273 ...
%e -1 22 235 2227 22223 ...
%e -1 27 222 2222 22222 ...
%e -1 132 225 2223 22225 ...
%e -1 32 252 2322 22232 ...
%e 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.
%p PD[1]:= [2,3,5,7]:
%p for i from 2 to 7 do PD[i]:= select(isprime,[seq(i,i=10^(i-1)+1..10^i-1,2)]) od:
%p dcat:= proc(a,b) 10^(ilog10(b)+1)*a+b end proc:
%p cp:= proc(m,n) option remember; local d,p,x,R;
%p if n = 1 then return PD[m] fi;
%p R:= {};
%p for d from 1 to m-n+1 do
%p R:= R union {seq(seq(dcat(p,x),p=PD[d]),x=procname(m-d,n-1))}
%p od;
%p R
%p end proc:
%p F:= proc(n,N)
%p local V,count,d,x,v;
%p if n = 1 then return <2,(-1)$(N-1)> fi;
%p V:= Vector(N); count:= 0;
%p for d from n while count < N do
%p for x in sort(convert(cp(d,n),list)) while count < N do
%p v:= numtheory:-bigomega(x);
%p if v <= N and V[v] = 0 then
%p V[v]:= x; count:= count+1;
%p fi
%p od od:
%p V;
%p end proc:
%p N:= 10: M:= Matrix(N,N):
%p for i from 1 to N do
%p V:= F(i,N+1-i);
%p M[i,1..N+1-i]:= V;
%p od:
%p [seq(seq(M[t-i,i],i=1..t-1),t=2..N+1)];
%Y Cf. A001222, A069837 (first row), A374665 (main diagonal), A374669 (second column).
%K sign,base
%O 1,1
%A _Robert Israel_, Jul 14 2024
|