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 A356839 #31 Sep 16 2022 02:10:49 %S A356839 1,9,9,33,33,33,33,33,33,105,105,59,59,59,59,59,125,191,191,117,117, %T A356839 117,117,117,117,117,117,117,117,117,117,117,117,381,381,381,381,381, %U A356839 227,227,227,227,227,227,227,227,227,227,227,227,429,631,631,631,631,191,417,873,873 %N A356839 a(n) = A005132(2*n) + A005132(2*n+1). %H A356839 Michel Marcus, <a href="/A356839/b356839.txt">Table of n, a(n) for n = 0..9999</a> %H A356839 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>. %t A356839 r[0] = 0; r[n_] := r[n] = If[(d = r[n - 1] - n) >= 0 && FreeQ[Array[r, n, 0], d], d, r[n - 1] + n]; a[n_] := r[2*n] + r[2*n + 1]; Array[a, 100, 0] (* _Amiram Eldar_, Sep 02 2022 *) %o A356839 (PARI) recaman(N)={ my(s, t, v=vector(N)); for(n=1, N, s=bitor(s, 1<<t += if( t<=n || bittest(s, t-n), n, -n)); v[n]=t); concat(0, v);} \\ adapted from A005132 %o A356839 lista(nn) = my(v=recaman(2*nn+2)); vector(nn, k, v[2*k] + v[2*k-1]); \\ _Michel Marcus_, Sep 02 2022 %o A356839 (Python) %o A356839 from itertools import count, islice %o A356839 def A356839_gen(): # generator of terms %o A356839 b, aset = 0, set() %o A356839 for n in count(1): %o A356839 aset.add(b) %o A356839 a, b = b, c if (c:=b-n)>=0 and c not in aset else b+n %o A356839 if n&1: %o A356839 yield a+b %o A356839 A356839_list = list(islice(A356839_gen(),70)) # _Chai Wah Wu_, Sep 15 2022 %Y A356839 Cf. A005132. %K A356839 nonn %O A356839 0,2 %A A356839 _Paul Curtz_, Aug 31 2022