login
a(0) = 2; for n > 0, a(n) is the least prime of the form k*n*a(n-1) + 1.
4

%I #18 Mar 05 2024 07:02:57

%S 2,3,7,43,173,3461,62299,6977489,55819913,8038067473,241142024191,

%T 15915373596607,2291813797911409,476697269965573073,

%U 20021285338554069067,10811494082819197296181,4670565443777893231950193

%N a(0) = 2; for n > 0, a(n) is the least prime of the form k*n*a(n-1) + 1.

%H Vincenzo Librandi, <a href="/A091771/b091771.txt">Table of n, a(n) for n = 0..100</a>

%t a[0] = 2; a[n_] := a[n] = Block[{k = 1}, While[ !PrimeQ[k*n*a[n - 1] + 1], k++ ]; k*n*a[n - 1] + 1]; Table[ a[n], {n, 0, 16}] (* _Robert G. Wilson v_, Feb 13 2004 *)

%t nxt[{n_,a_}]:=Module[{k=1},While[!PrimeQ[k (n+1)a+1],k++];{n+1,k(n+1)a+1}]; NestList[nxt,{0,2},20][[;;,2]] (* _Harvey P. Dale_, Mar 26 2023 *)

%Y Cf. A091879.

%K nonn

%O 0,1

%A _Amarnath Murthy_, Feb 11 2004

%E More terms from _Ray Chandler_, _Robert G. Wilson v_ and _Rick L. Shepherd_, Feb 12 2004