login
a(n) is the least k such that {A007504(1), A007504(2), ..., A007504(k)} mod n = {0,...,n-1}.
1

%I #14 Jun 12 2025 19:27:32

%S 1,2,10,20,10,57,18,24,20,35,25,97,49,27,67,43,115,113,60,62,97,50,

%T 107,187,98,92,72,94,66,230,125,132,191,130,180,168,91,113,142,199,

%U 157,305,184,224,242,229,119,297,200,292,179,133,198,341,357,286,324,329

%N a(n) is the least k such that {A007504(1), A007504(2), ..., A007504(k)} mod n = {0,...,n-1}.

%H Alois P. Heinz, <a href="/A384644/b384644.txt">Table of n, a(n) for n = 1..3000</a>

%e a(3) = 10: {2, 2, 1, 2, 1, 2, 1, 2, 1, 0} (2 mod 3 = 2, (2 + 3) mod 3 = 2, (2 + 3 + 5) mod 3 = 1, etc.).

%e a(4) = 20: {2, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 3}.

%o (PARI) a(n)={my(m=Map, s=0); for(i=1, oo, s+=prime(i); mapput(m, s%n, 1); if(#Vec(m)==n, return(i)))}

%o (Python)

%o from sympy import nextprime

%o def a(n):

%o k, p, residues, A007504_k = 0, 2, set(), 2

%o while len(residues) < n:

%o k, p, residues = k+1, nextprime(p), residues | {A007504_k%n}

%o A007504_k += p

%o return k

%o print([a(n) for n in range(1, 59)]) # _Michael S. Branicky_, Jun 12 2025

%Y Cf. A007504.

%K nonn

%O 1,2

%A _Charles L. Hohn_, Jun 05 2025