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 A261302 #23 Jan 17 2023 15:35:30 %S A261302 1,0,5,4,3,2,1,0,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,53,52,51, %T A261302 50,49,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22, %U A261302 21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,149,148,147,146,145,144,143 %N A261302 a(n+1) = abs(a(n) - gcd(a(n), 2n+1)), a(1) = 1. %C A261302 The absolute value is relevant only when a(n) = 0, in which case a(n+1) = gcd(a(n), 2n+1) = 2n+1. %C A261302 It is conjectured that for all n, a(n) = 0 implies that 2n+1 = a(n+1) is prime, cf. A186254. (This is the sequence {u(n)} mentioned there.) %H A261302 Harvey P. Dale, <a href="/A261302/b261302.txt">Table of n, a(n) for n = 1..1000</a> %e A261302 For n = 1, a(n) = 1 therefore a(n+1) = a(n) - gcd(a(n),2*n+1) = 1 - 1 = 0. The same is true for n = 7. %e A261302 a(2) = 0 therefore a(3) = gcd(0,2*2+1) = 5, which is prime. %e A261302 a(3+5) = a(8) = 0 therefore a(9) = gcd(0,2*8+1) = 17, which is also prime. %e A261302 a(9+17) = a(26) = 0 therefore a(27) = gcd(0,2*26+1) = 53, which is also prime. %e A261302 a(31) = 49 and 2*31+1 = 63, therefore a(32) = 49 - gcd(49,63) = 49 - 7 = 42. Note that for n = 31+49 = 80, 2n+1 = 161 would not be prime, but for n = 32+42 = 74, 2n+1 = 149 = a(75) is prime. %t A261302 nxt[{n_,a_}]:={n+1,Abs[a-GCD[a,2n+1]]}; NestList[nxt,{1,1},80][[All,2]] (* _Harvey P. Dale_, Jan 17 2023 *) %o A261302 (PARI) print1(a=1);for(n=1,99,print1(",",a=abs(a-gcd(a,2*n+1)))) %Y A261302 Cf. A261301 - A261310, A186253 - A186263, A106108. %K A261302 nonn,easy %O A261302 1,3 %A A261302 _M. F. Hasler_, Aug 14 2015