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-3 of 3 results.

A328106 Binary weight of A327971: a(n) = A000120(A110240(n) XOR A030101(A110240(n))).

Original entry on oeis.org

0, 0, 2, 2, 2, 4, 6, 4, 8, 10, 10, 8, 12, 8, 18, 6, 12, 26, 16, 18, 14, 18, 20, 22, 22, 26, 26, 38, 30, 26, 36, 26, 28, 36, 28, 18, 28, 42, 36, 32, 34, 40, 44, 38, 40, 50, 48, 48, 50, 58, 46, 56, 48, 42, 54, 48, 56, 56, 46, 54, 48, 52, 60, 58, 78, 74, 64, 60, 66, 74, 74, 64, 80, 74, 80, 62, 92, 62, 80, 70, 68, 100, 90, 82, 80, 92
Offset: 0

Views

Author

Antti Karttunen, Oct 05 2019

Keywords

Comments

a(n) is the number of times the k-th cell from the left is different from the k-th cell from the right, at the generation n of Rule 30 1-D cellular automaton, when it is started from a single alive cell.
All terms are even.

Examples

			The evolution of one-dimensional cellular automaton rule 30 proceeds as follows, when started from a single alive (1) cell:
---------------------------------------------- a(n)
   0:              (1)                          0
   1:             1(1)1                         0
   2:            11(0)01                        2
   3:           110(1)111                       2
   4:          1100(1)0001                      2
   5:         11011(1)10111                     4
   6:        110010(0)001001                    6
   7:       1101111(0)0111111                   4
   8:      11001000(1)11000001                  8
   9:     110111101(1)001000111                10
  10:    1100100001(0)1111011001               10
  11:   11011110011(0)10000101111               8
  12:  110010001110(0)110011010001             12
  13: 1101111011001(1)1011100110111             8
When we count the times the k-th cell from the left is different from the k-th cell from the right, we obtain a(n). Note that the central cells (indicated with parentheses) do not affect the count, as the central cell is always equal to itself.
		

Crossrefs

Programs

Formula

a(n) = Sum_{i=0..2n} abs(A070950(n,i)-A070950(n,n-i)).

A144079 a(n) = the number of digits in the binary representation of n that equal the corresponding digit in the binary reversal of n. (I.e., a(n) = number of 0's in n XOR A030101(n).)

Original entry on oeis.org

1, 0, 2, 1, 3, 1, 3, 2, 4, 0, 2, 0, 2, 2, 4, 3, 5, 1, 3, 3, 5, 1, 3, 1, 3, 3, 5, 1, 3, 3, 5, 4, 6, 2, 4, 2, 4, 0, 2, 2, 4, 0, 2, 4, 6, 2, 4, 2, 4, 4, 6, 0, 2, 2, 4, 0, 2, 2, 4, 2, 4, 4, 6, 5, 7, 3, 5, 3, 5, 1, 3, 5, 7, 3, 5, 3, 5, 1, 3, 3, 5, 1, 3, 5, 7, 3, 5, 3, 5, 1, 3, 5, 7, 3, 5, 3, 5, 5, 7, 1, 3, 3, 5, 3, 5
Offset: 1

Views

Author

Leroy Quet, Sep 09 2008

Keywords

Comments

A144078(n) + a(n) = A070939(n), the number of binary digits in n.

Examples

			20 in binary is 10100. Compare this with its digit reversal, 00101. XOR each pair of corresponding digits: 1 XOR 0 = 1, 0 XOR 0 = 0, 1 XOR 1 = 0, 0 XOR 0 = 0, 0 XOR 1 = 1. There are three bit pairs that contain the same values, so a(20) = 3.
		

Crossrefs

Programs

  • Maple
    A144079 := proc(n) local a,dgs,i; a := 0 ; dgs := convert(n,base,2) ; for i from 1 to nops(dgs) do if op(i,dgs)+op(-i,dgs) <> 1 then a := a+1 ; fi; od; RETURN(a) ; end: for n from 1 to 240 do printf("%d,",A144079(n)) ; od: # R. J. Mathar, Sep 14 2008
  • Mathematica
    Table[With[{c=IntegerDigits[n,2]},Count[BitXor[c,Reverse[c]],0]],{n,110}] (* Harvey P. Dale, Sep 03 2015 *)

Extensions

More terms from R. J. Mathar, Sep 14 2008

A274069 a(n) is the concatenation of a(n-1) and the Hamming distance between a(n-1) and its reverse (i.e., the minimum number of bitflips needed to make them identical). Sequence written in binary.

Original entry on oeis.org

1, 10, 1010, 1010100, 101010010, 101010010110, 101010010110100, 101010010110100100, 1010100101101001001000, 10101001011010010010001110, 101010010110100100100011101100, 10101001011010010010001110110010100, 101010010110100100100011101100101001100, 10101001011010010010001110110010100110011000, 10101001011010010010001110110010100110011000100000
Offset: 1

Views

Author

Meir-Simchah Panzer, Jun 09 2016

Keywords

Examples

			Let a'(n) be the reverse of a(n). E.g., if a(n) = 10100, then a'(n) = 00101. Let hamm(b,c) denote the Hamming distance between b and c. Let concat designate concatenation of arguments.
a(1):=1.
a(2) is the concatenation of a(1) and hamm(a(1),a'(1)). a'(1) = 1. So hamm(a(1),a'(1)) = hamm('1','1') = 0. So a(2) = concat('1','0') = 10.
a(3) is the concatenation of a(2) and hamm(a(2),a'(2)). hamm(a(2),a'(2)) = hamm('10','01') = 2 or 10 in base 2. So a(3) = concat('10','10') = 1010.
a(4) is the concatenation of a(3) and hamm(a(3),a'(3)). hamm(a(3),a'(3)) = hamm('1010','0101') = 4 or 100 in base 2. So a(3) = concat('1010','100') = 10100.
		

Crossrefs

Cf. A144078.

Programs

  • Maple
    A274069aux := proc(n)
        option remember;
        if n = 1 then
            [1];
        else
            d := procname(n-1) ;
            dreve := ListTools[Reverse](d) ;
            ham := 0 ;
            for i from 1 to nops(d) do
                if op(i,d) <> op(i,dreve) then
                    ham := ham+1 ;
                end if;
            end do:
            if ham = 0 then
                [op(d),0] ;
            else
                ListTools[Reverse](convert(ham,base,2)) ;
                [op(d),op(%) ] ;
            end if ;
        end if;
    end proc:
    A274069 := proc(n)
        digcatL(A274069aux(n)) ;
    end proc:
    seq(A274069(n),n=1..30) ; # R. J. Mathar, May 08 2019

Extensions

Edited by Meir-Simchah Panzer, Jun 12 2018
More terms from R. J. Mathar, May 08 2019.
Showing 1-3 of 3 results.