This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A330402 #11 Dec 16 2019 02:19:14 %S A330402 2,1,4,5,3,6,8,10,11,9,12,14,16,18,24,20,22,28,30,26,32,34,38,36,42, %T A330402 40,46,44,50,45,15,54,48,21,17,52,56,60,62,66,58,70,64,78,68,27,29,72, %U A330402 74,80,82,84,76,96,86,39,35,90,98,102,88,41,51,104,94,100 %N A330402 Lexicographically earliest sequence of distinct positive terms with an associate sequence t such that t(0) = 0, and for any n > 0, at least one of t(n-1) - a(n) or t(n-1) + a(n) is a prime number; in case t(n-1) - a(n) is a prime number, set t(n) = t(n-1) - a(n), otherwise set t(n) = t(n-1) + a(n). %C A330402 This sequence is a variant of A330401. %H A330402 Rémy Sigrist, <a href="/A330402/b330402.txt">Table of n, a(n) for n = 1..10000</a> %H A330402 Rémy Sigrist, <a href="/A330402/a330402.gp.txt">PARI program for A330402</a> %e A330402 The first terms, alongside t(n), are: %e A330402 n a(n) t(n) %e A330402 -- ---- ---- %e A330402 0 N/A 0 %e A330402 1 2 2 %e A330402 2 1 3 %e A330402 3 4 7 %e A330402 4 5 2 %e A330402 5 3 5 %e A330402 6 6 11 %e A330402 7 8 3 %e A330402 8 10 13 %e A330402 9 11 2 %e A330402 10 9 11 %e A330402 11 12 23 %e A330402 12 14 37 %o A330402 (PARI) See Links section. %Y A330402 Cf. A330401, A330421 (running totals). %K A330402 nonn %O A330402 1,1 %A A330402 _Rémy Sigrist_, Dec 13 2019