cp's OEIS Frontend

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.

A356870 a(n) = (A005132(2*n-1) + A005132(2*n))/4.

Original entry on oeis.org

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, 29, 29, 29, 29, 29, 29, 29, 62, 95, 95, 95, 95, 95, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 158, 158, 158, 158, 103, 48, 161, 218, 218, 99, 99, 99, 99, 99, 35, 35, 168, 100, 100, 100
Offset: 1

Views

Author

Paul Curtz, Sep 02 2022

Keywords

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    recaman(N)={ my(s, t, v=vector(N)); for(n=1, N, s=bitor(s, 1<A005132
    lista(nn) = my(v=recaman(2*nn+2)); vector(nn, k, v[2*k-1] + v[2*k])/4; \\ Michel Marcus, Sep 13 2022
    
  • Python
    from itertools import count, islice
    def A356870_gen(): # generator of terms
        b, aset = 0, set()
        for n in count(1):
            aset.add(b)
            a, b = b, c if (c:=b-n)>=0 and c not in aset else b+n
            if not n&1:
                yield a+b>>2
    A356870_list = list(islice(A356870_gen(),30)) # Chai Wah Wu, Sep 15 2022

Extensions

New name, data and offset from Michel Marcus, Sep 13 2022