The OEIS is supported by the many generous donors to the OEIS Foundation.

`%I #9 Apr 30 2021 11:42:20
`

`%S 1,2,4,7,25,12,16,37,24,32,33,40,67,63,48,58,78,60,81,50,102,91,114,
`

`%T 109,110,116,117,124,130,137,120,128,152,168,190,183,184,186,215,199,
`

`%U 206,202,259,235,208,264,261,256,269,274,281,318,272,301,316,330,329,342,327,352,326,376,346,312
`

`%N a(n) is the least k such that A343796(k) = n, or 0 if there is no such k.
`

`%C a(n) is the least k such that there are exactly n distinct primes of the form A007504(k) mod p for the first k primes p.
`

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

`%e a(4) = 25 because A007504(25) = 1060 and there are 4 primes of the form 1060 mod p for the first 25 primes p: 2 = 1060 mod 23, 3 = 1060 mod 7, 7 = 1060 mod 13 and 23 = 1060 mod 61, and 25 is the first k that produces exactly 4 primes in this way.
`

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

`%p V:= Array(0..N): count:= 0:
`

`%p P:= {}: p:= 1: t:= 0:
`

`%p for n from 1 while count < 100 do
`

`%p p:= nextprime(p); P:= P union {p}; t:= t+p;
`

`%p v:= nops(select(isprime, map(s -> t mod s, P)));
`

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

`%p V[v]:= n; count:= count+1;
`

`%p fi
`

`%p od:
`

`%p convert(V,list);
`

`%Y Cf. A007504, A343796.
`

`%K nonn
`

`%O 0,2
`

`%A _J. M. Bergot_ and _Robert Israel_, Apr 29 2021
`