OFFSET
1,2
EXAMPLE
a(1) = 1, because 1*prime(1) mod 1 = 2 mod 1 = 0 and no lesser number has this property.
a(2) = 4, because 1*prime(1) + 4*prime(4) mod (1+4) = 30 mod 5 = 0 and no lesser number has this property.
PROG
(PARI) is(u)=my(v=vector(#u, x, prime(u[x]))); my(r=u*v~%vecsum(u)); if(r==0, 1, 0)
find(k, n)=forsubset([k, n], s, my(u=Vec(s)); if(is(u), return(k))); 0
a(n)=my(k=n, u=find(k, n)); while(u==0, k++; u=find(k, n)); k
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Nov 04 2023
STATUS
approved