login
a(n) = prime(A178215(n)) mod prime(n).
1

%I #15 May 11 2019 02:12:12

%S 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,

%T 16,105,44,56,14,76,87,129,22,138,85,50,82,130,69,93,18,60,135,170,

%U 105,110,225,44

%N a(n) = prime(A178215(n)) mod prime(n).

%C a(n) is the last residue modulo prime(n) in the minimal set of the first primes which contains all residues modulo prime(n).

%C 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

%e 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.

%p 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

%Y Cf. A000040, A178215.

%K nonn

%O 1,3

%A _Vladimir Shevelev_, May 22 2010

%E a(10) corrected, more terms appended by _R. J. Mathar_, Oct 25 2010

%E Name corrected by _Jon E. Schoenfield_, May 10 2019