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.

Previous Showing 11-13 of 13 results.

A216195 Abelian complexity function of the period-doubling sequence (A096268).

Original entry on oeis.org

2, 2, 3, 2, 3, 3, 3, 2, 3, 3, 4, 3, 4, 3, 3, 2, 3, 3, 4, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 3, 3, 2, 3, 3, 4, 3, 4, 4, 4, 3, 4, 4, 5, 4, 5, 4, 4, 3, 4, 4, 5, 4, 5, 4, 4, 3, 4, 4, 4, 3, 4, 3, 3, 2, 3, 3, 4, 3, 4, 4, 4, 3, 4, 4, 5, 4, 5, 4, 4, 3, 4, 4, 5, 4, 5, 5, 5, 4, 5, 5, 5, 4, 5, 4, 4, 3, 4, 4, 5
Offset: 1

Views

Author

Nathan Fox, Mar 12 2013

Keywords

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Programs

  • Mathematica
    a[n_]:=Count[BitXor[b1=IntegerDigits[n, 2]; b3=IntegerDigits[3*n, 2]; PadLeft[b1, Length[b3]], b3], 1]; Table[a[n] + 1, {n, 1, 100}] (* Vincenzo Librandi, Jan 13 2017 *)

Formula

a(1) = 2; a(2n) = a(n); a(4n-1) = a(n) + 1; a(4n+1) = a(n) + 1.
a(n) = A007302(n) + 1.

A216199 Abelian complexity function of the ternary Thue-Morse word (A036577).

Original entry on oeis.org

3, 3, 5, 3, 4, 5, 4, 3, 5, 4, 6, 5, 6, 4, 5, 3, 4, 5, 6, 4, 6, 6, 6, 5, 6, 6, 6, 4, 6, 5, 4, 3, 5, 4, 6, 5, 6, 6, 6, 4, 6, 6, 8, 6, 7, 6, 6, 5, 6, 6, 7, 6, 8, 6, 6, 4, 6, 6, 6, 5, 6, 4, 5, 3, 4, 5, 6, 4, 6, 6, 6, 5, 6, 6, 7, 6, 8, 6, 6, 4, 6, 6, 8, 6, 7, 8, 7, 6, 8, 7, 8, 6, 7, 6, 6, 5, 6, 6, 7
Offset: 1

Views

Author

Nathan Fox, Mar 12 2013

Keywords

Comments

abs(a(n) - (3/2)*(A007302(n) + 1)) <= 1/2.

Crossrefs

A309709 Number of binary digits that change when n is multiplied by 4.

Original entry on oeis.org

0, 2, 2, 4, 2, 2, 4, 4, 2, 4, 2, 4, 4, 4, 4, 4, 2, 4, 4, 6, 2, 2, 4, 4, 4, 6, 4, 6, 4, 4, 4, 4, 2, 4, 4, 6, 4, 4, 6, 6, 2, 4, 2, 4, 4, 4, 4, 4, 4, 6, 6, 8, 4, 4, 6, 6, 4, 6, 4, 6, 4, 4, 4, 4, 2, 4, 4, 6, 4, 4, 6, 6, 4, 6, 4, 6, 6, 6, 6, 6, 2, 4, 4, 6, 2, 2, 4, 4
Offset: 0

Views

Author

Ali Sada, Aug 14 2019

Keywords

Comments

All terms are even.

Examples

			00101_2 * 100_2 = 10100_2: 2 bits changed, so a(5) = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(i, i=Bits[Split](Bits[Xor](n*4,n))):
    seq(a(n), n=0..120);  # Alois P. Heinz, Aug 23 2019
  • Mathematica
    a[n_] := Total@ IntegerDigits[BitXor[n, 4 n], 2]; Array[a, 88, 0] (* Giovanni Resta, Sep 19 2019 *)
  • PARI
    A309709(n) = hammingweight(bitxor(n, n<<2)); \\ Antti Karttunen, Aug 22 2019
    
  • Python
    def A309709(n):
        s = ""
        while n > 0:
            s, n = str(n%2)+s,n//2
        s, s4, i, j = "00"+s, s+"00", 0, 0
        while i < len(s):
            if s[i] != s4[i]:
                j = j+1
            i = i+1
        return j # A.H.M. Smeets, Aug 23 2019

Formula

a(n) = A000120(A048725(n)). - Antti Karttunen, Aug 22 2019
a(A112627(n)) = 2*n and A112627(n) is the first position where 2*n occurs in this sequence. - David A. Corneth, Sep 19 2019
Previous Showing 11-13 of 13 results.