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.

A356839 a(n) = A005132(2*n) + A005132(2*n+1).

Original entry on oeis.org

1, 9, 9, 33, 33, 33, 33, 33, 33, 105, 105, 59, 59, 59, 59, 59, 125, 191, 191, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 381, 381, 381, 381, 381, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 429, 631, 631, 631, 631, 191, 417, 873, 873
Offset: 0

Views

Author

Paul Curtz, Aug 31 2022

Keywords

Crossrefs

Cf. A005132.

Programs

  • Mathematica
    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 *)
  • 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] + v[2*k-1]); \\ Michel Marcus, Sep 02 2022
    
  • Python
    from itertools import count, islice
    def A356839_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 n&1:
                yield a+b
    A356839_list = list(islice(A356839_gen(),70)) # Chai Wah Wu, Sep 15 2022