login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A367063
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
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, 28, 30, 30, 31, 33, 33, 34, 35, 37, 38, 39, 40, 40, 41, 42, 44, 44, 45, 46, 48, 49, 50, 51, 52, 52, 53, 55, 55, 56, 58, 59, 59, 60, 62, 61, 63, 64, 66, 67, 67, 67, 69, 70
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
Sequence in context: A090925 A143836 A168094 * A089166 A178052 A030543
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Nov 04 2023
STATUS
approved