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.

A283986 a(n) = A002487(n-1) OR A002487(n), where OR is bitwise-or (A003986).

Original entry on oeis.org

1, 1, 3, 3, 3, 3, 3, 3, 5, 7, 7, 7, 7, 7, 7, 5, 5, 5, 7, 7, 11, 13, 7, 7, 7, 7, 13, 11, 7, 7, 5, 5, 7, 7, 13, 13, 15, 15, 15, 11, 11, 11, 13, 13, 13, 15, 15, 11, 11, 15, 15, 13, 13, 13, 11, 11, 11, 15, 15, 15, 13, 13, 7, 7, 7, 7, 15, 15, 15, 15, 13, 13, 15, 15, 27, 23, 23, 27, 15, 15, 15, 15, 27, 27, 29, 29, 31, 23, 21, 29, 31, 23, 23, 25, 11, 11, 11, 11, 25
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283976.
Cf. A283973 (positions where coincides with A007306, equally, with A283987).

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[BitOr[a[n - 1], a@ n], {n, 120}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    for(n=1, 101, print1(bitor(A(n - 1), A(n))", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283986(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0)))|sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n-1)[-1:2:-1],(1,0))) # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283986 n) (A003986bi (A002487 (- n 1)) (A002487 n))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

a(n) = A002487(n-1) OR A002487(n), where OR is bitwise-or (A003986).
a(n) = A283987(n) + A283988(n).
a(n) = A007306(n) - A283988(n).
a(n) = A283976((2*n)-1).

A283977 a(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 1, 1, 0, 1, 3, 2, 3, 1, 2, 3, 1, 2, 1, 3, 2, 1, 5, 4, 7, 3, 6, 5, 7, 2, 7, 5, 6, 3, 7, 4, 5, 1, 4, 5, 1, 4, 3, 7, 4, 3, 11, 8, 13, 5, 2, 7, 5, 2, 5, 7, 2, 5, 13, 8, 11, 3, 4, 7, 3, 4, 1, 5, 4, 1, 7, 6, 3, 5, 12, 9, 13, 4, 15, 11, 12, 7, 13, 10, 9, 3, 8, 11, 3, 8, 5, 13, 8, 5, 9, 12, 11, 7, 14, 9, 11, 2, 11, 9, 14, 7, 11, 12, 9, 5, 8, 13, 5, 8, 3, 11, 8, 3
Offset: 0

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Bisections: A002487, A283987.

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, a[n/2], BitXor[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 112}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, n, if(n%2, bitxor(A(n\2), A((n + 1)/2)), A(n\2)));
    for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283977 n) (if (even? n) (A002487 n) (A003987bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(2n) = A002487(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).
a(n) = A283976(n) - A283978(n).
a(n) = A002487(n) - 2*A283978(n).

A283978 a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, 0, BitAnd[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 120}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, 0, if(n%2, bitand(A(n\2), A((n + 1)/2)), 0));
    for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283978 n) (if (even? n) 0 (A004198bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).
a(n) = A283976(n) - A283977(n).
a(n) = A002487(n) - A283976(n) = (A002487(n) - A283977(n))/2.
Showing 1-3 of 3 results.