login
A178216
a(n) = prime(A178215(n)) mod prime(n).
1
1, 1, 4, 1, 10, 12, 1, 1, 22, 27, 1, 32, 10, 33, 27, 24, 1, 24, 8, 48, 72, 55, 39, 69, 44, 22, 16, 105, 44, 56, 14, 76, 87, 129, 22, 138, 85, 50, 82, 130, 69, 93, 18, 60, 135, 170, 105, 110, 225, 44
OFFSET
1,3
COMMENTS
a(n) is the last residue modulo prime(n) in the minimal set of the first primes which contains all residues modulo prime(n).
Build the smallest set {prime(1), prime(2), ..., prime(k)} of the first k consecutive primes such that the set {prime(1) mod prime(n), prime(2) mod prime(n), ..., prime(k) mod prime(n)} contains all residues {0, 1, 2, ..., prime(n)-1}. Then a(n) = prime(k) mod prime(n). - R. J. Mathar, Oct 25 2010
EXAMPLE
If n=3, then prime(n)=5 and {2,3,5,7,11,13,17,19} is the minimal set of the first primes which contains all residues modulo 5. We have consecutive residues {2,3,0,2,1,3,2,4}. Therefore a(3)=4.
MAPLE
A178216 := proc(n) local p, k, modP, i ; p := ithprime(n) ; for k from 1 do modP := [seq( ithprime(j) mod p, j=1..k)] ; {seq(i, i=0..p-1)} minus convert(modP, set) ; if % = {} then return op(-1, modP) ; end if; end do: end proc: seq(A178216(n), n=1..50) ; # R. J. Mathar, Oct 25 2010
CROSSREFS
Sequence in context: A349809 A182971 A062145 * A307529 A019213 A019128
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, May 22 2010
EXTENSIONS
a(10) corrected, more terms appended by R. J. Mathar, Oct 25 2010
Name corrected by Jon E. Schoenfield, May 10 2019
STATUS
approved