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”).

Prime at which n appears for the first time in A102350.
2

%I #6 Oct 23 2020 18:19:15

%S 2,5,13,17,37,47,73,89,113,137,193,233,293,277,373,359,401,499,467,

%T 613,577,743,877,857,701,991,863,1223,1153,1109,1307,1571,1609,1493,

%U 1637,2053,1783,1889,1913,2017,2221,2063,2161,2381,2467,2333,2677,2719,2633

%N Prime at which n appears for the first time in A102350.

%C The least prime which has n prime prime residues.

%H Robert Israel, <a href="/A102854/b102854.txt">Table of n, a(n) for n = 0..1000</a>

%p N:= 100: # for a(0)..a(N)

%p count:= 0: B:= Array(0..N): p:= 1:

%p for i from 1 while count < N+1 do

%p p:= nextprime(p);

%p P[i]:= p;

%p v:= nops(select(isprime,[seq(p mod P[j],j=1..i-1)]));

%p if v <= N and B[v] = 0 then

%p B[v]:= p; count:= count+1;

%p fi

%p od:

%p convert(B,list); # _Robert Israel_, Oct 23 2020

%t f[n_] := Length[ Select[ Mod[ Prime[n], Prime[ Range[n]]], PrimeQ[ # ] &]]; g[n_] := Block[{k = 1}, While[ f[ k] != n, k++ ]; Prime[k]]; Table[ g[n], {n, 0, 48}]

%Y Cf. A102351.

%K nonn

%O 0,1

%A _Robert G. Wilson v_, Feb 28 2005