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.

A362942 Partial sums of A229037.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 10, 14, 18, 19, 20, 22, 23, 24, 26, 28, 32, 36, 38, 42, 46, 51, 56, 64, 69, 74, 83, 84, 85, 87, 88, 89, 91, 93, 97, 101, 102, 103, 105, 106, 107, 109, 111, 115, 119, 121, 125, 129, 134, 139, 147, 152, 157, 166, 175, 179, 183, 188, 193
Offset: 1

Views

Author

N. J. A. Sloane, Sep 12 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{z = 1}, While[Catch[Do[If[z == 2*a[n - k] - a[n - 2*k], Throw@ True], {k, Floor[(n - 1)/2]}]; False], z++]; z]; Accumulate@ Array[a, 120] (* Michael De Vlieger, Sep 12 2023, after Giovanni Resta at A229037 *)
  • Python
    from itertools import count, islice
    def A362942_gen(): # generator of terms
        blist, c = [], 0
        for n in count(0):
            i, j, b = 1, 1, set()
            while n-(i<<1) >= 0:
                b.add((blist[n-i]<<1)-blist[n-2*i])
                i += 1
                while j in b:
                    j += 1
            blist.append(j)
            yield (c:=c+j)
    A362942_list = list(islice(A362942_gen(),30)) # Chai Wah Wu, Sep 12 2023