%I #10 Aug 28 2017 13:18:07
%S 2,3,6,4,12,10,16,12,16,24,26,24,30,28,28,44,36,42,20,38,34,54,54,56,
%T 48,44,50,52,68,56,56,60,62,66,66,70,76,84,76,58,92,90,88,90,80,88,92,
%U 102,104,102,114,104,108,98,114,108,92,100,120,126,124,130,126,142,116,126
%N Consider the array of sequences defined to be "the least previously nonoccurring positive integer such that partial sum + k is prime" beginning with k=0. This sequence is the main diagonal of that array.
%H Chai Wah Wu, <a href="/A122866/b122866.txt">Table of n, a(n) for n = 0..10000</a>
%e The array of sequences begins
%e k= 0: 2, 1, 4, 6, 10, 8, 12, 16, 14, 24, 30, 22, 18, 26, 34, ...,.
%e k= 1: 1, 3, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, ...,.
%e k= 2: 1, 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, ...,.
%e k= 3: 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, 34, ...,.
%e k= 4: 1, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, ...,.
%e k= 5: 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, 28, ...,.
%t f[s_] := Append[s, k = 1; p = q + Plus @@ s; While[MemberQ[s, k] || !PrimeQ[p + k], k++ ]; k]; T[n_, k_] := Nest[q = k; f, {}, n][[ -1]]; Table[T[n, n - 1], {n, 66}]
%Y Cf. A054408, A121861, A121862, A122867.
%K nonn
%O 0,1
%A _Jonathan Vos Post_ and _Robert G. Wilson v_, Sep 15 2006
%E Offset changed to 0 by _Chai Wah Wu_, Aug 27 2017