login
Least number k such that there exists a subset u of n distinct elements of {1..k} for which Sum_{i = 1..n} u(i) * prime(u(i)) mod Sum_{i = 1..n} u(i) = 0.
0

%I #24 Jan 25 2024 07:43:59

%S 1,4,5,6,7,8,9,9,12,13,14,15,16,16,18,18,19,20,22,22,23,24,25,27,28,

%T 28,30,30,31,33,33,34,35,37,38,39,40,40,41,42,44,44,45,46,48,49,50,51,

%U 52,52,53,55,55,56,58,59,59,60,62,61,63,64,66,67,67,67,69,70

%N Least number k such that there exists a subset u of n distinct elements of {1..k} for which Sum_{i = 1..n} u(i) * prime(u(i)) mod Sum_{i = 1..n} u(i) = 0.

%e a(1) = 1, because 1*prime(1) mod 1 = 2 mod 1 = 0 and no lesser number has this property.

%e a(2) = 4, because 1*prime(1) + 4*prime(4) mod (1+4) = 30 mod 5 = 0 and no lesser number has this property.

%o (PARI) is(u)=my(v=vector(#u,x,prime(u[x])));my(r=u*v~%vecsum(u));if(r==0,1,0)

%o find(k,n)=forsubset([k,n],s,my(u=Vec(s));if(is(u),return(k)));0

%o a(n)=my(k=n,u=find(k,n));while(u==0,k++;u=find(k,n));k

%K nonn

%O 1,2

%A _Jean-Marc Rebert_, Nov 04 2023