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 A356870 #53 Sep 16 2022 10:16:07 %S A356870 1,2,5,8,8,8,8,8,17,26,26,15,15,15,15,15,48,48,29,29,29,29,29,29,29, %T A356870 29,29,29,29,29,29,29,62,95,95,95,95,95,57,57,57,57,57,57,57,57,57,57, %U A356870 57,57,158,158,158,158,103,48,161,218,218,99,99,99,99,99,35,35,168,100,100,100 %N A356870 a(n) = (A005132(2*n-1) + A005132(2*n))/4. %H A356870 Michel Marcus, <a href="/A356870/b356870.txt">Table of n, a(n) for n = 1..10000</a> %t A356870 r[-1] = 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 - 1] + r[2*n])/4; Array[a, 100] (* _Amiram Eldar_, Sep 02 2022 *) %o A356870 (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); v; } \\ adapted from A005132 %o A356870 lista(nn) = my(v=recaman(2*nn+2)); vector(nn, k, v[2*k-1] + v[2*k])/4; \\ _Michel Marcus_, Sep 13 2022 %o A356870 (Python) %o A356870 from itertools import count, islice %o A356870 def A356870_gen(): # generator of terms %o A356870 b, aset = 0, set() %o A356870 for n in count(1): %o A356870 aset.add(b) %o A356870 a, b = b, c if (c:=b-n)>=0 and c not in aset else b+n %o A356870 if not n&1: %o A356870 yield a+b>>2 %o A356870 A356870_list = list(islice(A356870_gen(),30)) # _Chai Wah Wu_, Sep 15 2022 %Y A356870 Cf. A005132, A356839. %K A356870 nonn,look %O A356870 1,2 %A A356870 _Paul Curtz_, Sep 02 2022 %E A356870 New name, data and offset from _Michel Marcus_, Sep 13 2022