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.

A283997 a(n) = n XOR A005187(floor(n/2)), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 2, 3, 15, 14, 2, 3, 6, 7, 5, 4, 31, 30, 2, 3, 6, 7, 5, 4, 14, 15, 13, 12, 5, 4, 4, 5, 63, 62, 2, 3, 6, 7, 5, 4, 14, 15, 13, 12, 5, 4, 4, 5, 30, 31, 29, 28, 5, 4, 4, 5, 13, 12, 12, 13, 4, 5, 7, 6, 127, 126, 2, 3, 6, 7, 5, 4, 14, 15, 13, 12, 5, 4, 4, 5, 30, 31, 29, 28, 5, 4, 4, 5, 13, 12, 12, 13, 4, 5, 7, 6, 62, 63, 61, 60, 5, 4, 4, 5, 13, 12, 12
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[BitXor[n, 2 # - DigitCount[2 #, 2, 1] &@ Floor[n/2]], {n, 0, 106}] (* Michael De Vlieger, Mar 20 2017 *)
  • PARI
    b(n) = if(n<1, 0, b(n\2) + n%2);
    A(n) = 2*n - b(2*n);
    for(n=0, 110, print1(bitxor(n, A(floor(n/2))),", ")) \\ Indranil Ghosh, Mar 25 2017
    
  • Python
    def A(n): return 2*n - bin(2*n)[2:].count("1")
    print([n^A(n//2) for n in range(111)]) # Indranil Ghosh, Mar 25 2017
  • Scheme
    (define (A283997 n) (A003987bi n (A005187 (floor->exact (/ n 2))))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(n) = n XOR A005187(floor(n/2)), where XOR is bitwise-xor (A003987).
a(n) = A283996(n) - A283998(n).
a(n) = A005187(n) - 2*A283998(n).
a(n) = A006068(n) XOR A283999(floor(n/2)).

A283996 a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986).

Original entry on oeis.org

0, 1, 3, 3, 7, 7, 6, 7, 15, 15, 10, 11, 14, 15, 15, 15, 31, 31, 18, 19, 22, 23, 23, 23, 30, 31, 31, 31, 29, 29, 30, 31, 63, 63, 34, 35, 38, 39, 39, 39, 46, 47, 47, 47, 45, 45, 46, 47, 62, 63, 63, 63, 53, 53, 54, 55, 61, 61, 62, 63, 60, 61, 63, 63, 127, 127, 66, 67, 70, 71, 71, 71, 78, 79, 79, 79, 77, 77, 78, 79, 94, 95, 95, 95, 85, 85, 86, 87, 93, 93, 94, 95
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Crossrefs

Programs

  • Mathematica
    A[n_]:=2*n - DigitCount[2*n, 2, 1]; Table[BitOr[n, A[Floor[n/2]]], {n,0,100}] (* Indranil Ghosh, Mar 25 2017 *)
  • PARI
    b(n) = if(n<1, 0, b(n\2) + n%2);
    A(n) = 2*n - b(2*n);
    for(n=0, 100, print1(bitor(n, A(floor(n/2))),", ")) \\ Indranil Ghosh, Mar 25 2017
    
  • Python
    def A(n): return 2*n - bin(2*n)[2:].count("1")
    print([n|A(n//2) for n in range(101)]) # Indranil Ghosh, Mar 25 2017
  • Scheme
    (define (A283996 n) (A003986bi n (A005187 (floor->exact (/ n 2))))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986).
a(n) = A283997(n) + A283998(n).
a(n) = A005187(n) - A283998(n).
Showing 1-2 of 2 results.