OFFSET
2,1
COMMENTS
If the value of the terminal prime is given rather than its index in the list of odd primes, the sequence becomes 7 19 29 43 103 103 191 137 347 311 439
In other words, the odd primes no larger than 7 form a complete residue set mod 3, the odd primes no larger than 19 form a complete residue set mod 5, and so forth
LINKS
Robert Israel, Table of n, a(n) for n = 2..5000
MAPLE
P:= select(isprime, [2, seq(i, i=3..10^6, 2)]):
f:= proc(n) local S, k;
S:= {$0..P[n]-1}:
for k from 1 do
S:= S minus {P[k+1] mod P[n]};
if S = {} then return k fi;
od
end proc;
map(f, [$2..100]); # Robert Israel, Nov 04 2025
MATHEMATICA
Table[p=Prime[n]; k=1; While[u=Union[Mod[Prime[Range[2, k]], p]]; u != Range[0, p-1], k++ ]; k-1, {n, 2, 100}] (* T. D. Noe, Apr 02 2010 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Keith Backman, Mar 30 2010
EXTENSIONS
Name improved by T. D. Noe, Apr 05 2010
Corrected and extended by T. D. Noe, Apr 02 2010
Offset corrected by Robert Israel, Nov 03 2025
STATUS
approved
