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”).
%I #24 Sep 08 2022 08:46:24
%S 2,7,11,23,43,67,83,173,167,227,367,331,503,607,727,827,1031,1447,
%T 1223,1163,1523,1973,2957,2357,1811,3083,3631,3607,4423,5419,6779,
%U 5297,6353,7207,7307,7817,9803,6563,8861,8123,10223,10883,13331,10853,14423,14419,17597,15307,15083,15889,21227,19403
%N a(n) is the first prime p such that A329308(p) = n.
%H Robert Israel, <a href="/A329309/b329309.txt">Table of n, a(n) for n = 0..325</a>
%e a(3)=23 because A329308(23)=3 and 23 is the least prime with this property.
%p f:= proc(n) local k; nops(select(isprime, [seq(n mod k^2, k=2..floor(sqrt(n)))])) end proc:
%p V:= Array(0..100): count:= 0: p:= 0:
%p while count < 101 do
%p p:= nextprime(p);
%p v:= f(p);
%p if v <= 100 and V[v]=0 then
%p count:= count+1; V[v]:= p;
%p fi
%p od:
%p convert(V,list);
%t b[n_] := b[n] = (* A329309 *) Select[Range[2, Sqrt[n] // Floor], PrimeQ[ Mod[n, #^2]]&] // Length;
%t a[n_] := For[p = 2, True, p = NextPrime[p], If[b[p] == n, Print[n, " ", p]; Return[p]]];
%t a /@ Range[0, 100] (* _Jean-François Alcover_, Aug 22 2020 *)
%o (Magma) a:=[]; for n in [0..50] do p:=2; while #[ k:k in [2..Floor(Sqrt(p))]| IsPrime(p mod k^2) ] ne n do p:=NextPrime(p); end while; Append(~a,p); end for; a; // _Marius A. Burtea_, Nov 11 2019
%Y Cf. A329308.
%K nonn
%O 0,1
%A _J. M. Bergot_ and _Robert Israel_, Nov 09 2019