OFFSET
1,1
MAPLE
A077322 := proc(nmax) local n, a, T, i, p ; T := [] ; a := [] ; n :=1 ; while nops(a) < nmax do for i from 1 to n do p := 2 ; while ( p in T ) or (p-1) mod n <> 0 do p := nextprime(p) ; od ; T := [op(T), p] ; if i = 1 then a := [op(a), p] ; fi ; od ; n := n+1 ; od ; RETURN(a) ; end: A077322(50) ; # R. J. Mathar, Feb 03 2007
MATHEMATICA
nrows = 50;
A077321[nmax_] := Module[{n = 1, a = {}, i, p}, While[ Length[a] < nmax, For[i = 1, i <= n, i++, p = 2; While[MemberQ[a, p] || Mod[p - 1, n] != 0, p = NextPrime[p]]; a = Append[a, p]]; n = n + 1]; Return[a]];
T = A077321[nmax = (nrows^2 - nrows + 2)/2];
a[n_] := T[[(n^2 - n + 2)/2]];
Table[a[n], {n, 1, nrows}] (* Jean-François Alcover, May 30 2023, after R. J. Mathar *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Nov 04 2002
EXTENSIONS
More terms from R. J. Mathar, Feb 03 2007
STATUS
approved