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.

Showing 1-2 of 2 results.

A019299 First n elements of Thue-Morse sequence A010059 read as a binary number.

Original entry on oeis.org

1, 2, 4, 9, 18, 37, 75, 150, 300, 601, 1203, 2406, 4813, 9626, 19252, 38505, 77010, 154021, 308043, 616086, 1232173, 2464346, 4928692, 9857385, 19714771, 39429542, 78859084, 157718169, 315436338, 630872677, 1261745355, 2523490710, 5046981420
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A001969 (evil numbers), A010060, A014571, A125050.

Programs

  • Maple
    a:= n-> add((1+(-1)^irem(add(j, j=convert(n-i, base, 2)), 2))*2^i/2, i=0..n):
    seq(a(n), n=0..32); # Lorenzo Sauras Altuzarra, Jan 31 2023

Formula

a(n) = Sum_{k=0..n} (1+(-1)^A010060(n-k))*2^k/2. - Paul Barry, Jan 06 2005
From Lorenzo Sauras Altuzarra, Jan 31 2023: (Start)
a(n+1) = 2*a(n) + 1 if a(n) is evil; a(n+1) = 2*a(n) otherwise (see also A125050).
a(n) = floor((1-c)*2^(n+1)), where c = A014571 is the Thue - Morse constant. (End)

A125049 a(1) = 1. If a(n) is prime, a(n+1) = 2*a(n); otherwise, a(n+1) = 2*a(n) + 1.

Original entry on oeis.org

1, 3, 6, 13, 26, 53, 106, 213, 427, 855, 1711, 3423, 6847, 13695, 27391, 54783, 109567, 219134, 438269, 876539, 1753079, 3506159, 7012318, 14024637, 28049275, 56098551, 112197103, 224394207, 448788415, 897576831, 1795153663, 3590307326
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A125050.

Programs

  • Maple
    a := proc(n)
       local c, k:
       c, k := 1, 1:
       while c < n do
          if isprime(k) then k := 2*k: else k := 2*k+1: fi:
          c := c+1: od:
       k: end: # Lorenzo Sauras Altuzarra, Jan 02 2023
  • Mathematica
    NestList[If[PrimeQ[#],2#,2#+1]&,1,40] (* Harvey P. Dale, Sep 01 2017 *)

Formula

a(n) = floor(c*2^n), where c = 0.8359335658... - Lorenzo Sauras Altuzarra, Jan 01 2023
Showing 1-2 of 2 results.