login
Least prime of the form n*T_i +/-1, where T is a triangular number.
6

%I #4 Mar 30 2012 18:40:42

%S 2,3,2,3,29,5,41,7,53,11,67,11,79,13,89,17,101,17,113,19,127,23,137,

%T 23,149,79,163,29,173,29,311,31,197,101,211,37,223,37,233,41,409,41,

%U 257,43,269,47,281,47,293,149,307,53,317,53,331,167,569,59,353,59,367,61,379

%N Least prime of the form n*T_i +/-1, where T is a triangular number.

%t f[n_] := Block[{k = 1, s = {}, trnglr}, While[s == {}, trnglr = n*k(k + 1)/2; If[PrimeQ[trnglr - 1], AppendTo[s, trnglr - 1]]; If[PrimeQ[trnglr + 1], AppendTo[s, trnglr + 1]]; k++ ]; s[[1]]]; Array[f, 63]

%Y Cf. A000217, A125765, A125766, A125768, A125769.

%K nonn

%O 1,1

%A _Jonathan Vos Post_ & _Robert G. Wilson v_, Dec 01 2006