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-4 of 4 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).

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

Original entry on oeis.org

1, 0, 3, 3, 2, 1, 1, 2, 5, 7, 6, 7, 7, 6, 7, 5, 4, 1, 3, 4, 11, 13, 2, 5, 5, 2, 13, 11, 4, 3, 1, 4, 7, 3, 12, 13, 15, 12, 13, 9, 8, 3, 5, 8, 9, 11, 14, 11, 11, 14, 11, 9, 8, 5, 3, 8, 9, 13, 12, 15, 13, 12, 3, 7, 6, 1, 13, 14, 11, 7, 4, 9, 11, 4, 25, 21, 22, 27, 7, 14, 13, 5, 24, 27, 29, 24, 31, 23, 20, 29, 31, 20, 23, 25, 2, 9, 9, 2, 25, 23, 20, 31, 29, 20, 23
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283977.
Cf. A283973 (positions where coincides with A007306, or equally, with A283986).

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[BitXor[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, 120, print1(bitxor(A(n - 1), A(n)), ", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283987(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))) if n>1 else 1 # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283987 n) (A003987bi (A002487 (- n 1)) (A002487 n))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(n) = A002487(n-1) XOR A002487(n), where XOR is bitwise-xor (A003987).
a(n) = A283986(n) - A283988(n).
a(n) = A007306(n) - 2*A283988(n).
a(n) = A283977((2*n)-1).

A283988 a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).

Original entry on oeis.org

0, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 4, 4, 3, 0, 0, 5, 2, 2, 5, 0, 0, 3, 4, 4, 1, 0, 4, 1, 0, 0, 3, 2, 2, 3, 8, 8, 5, 4, 4, 1, 0, 0, 1, 4, 4, 5, 8, 8, 3, 2, 2, 3, 0, 0, 1, 4, 0, 1, 6, 2, 1, 4, 8, 9, 4, 4, 11, 2, 2, 1, 0, 8, 1, 2, 10, 3, 0, 0, 5, 0, 0, 1, 0, 0, 3, 0, 0, 9, 2, 2, 9, 0, 0, 3, 0, 0, 1, 0, 0, 5, 0, 0, 3, 10, 2, 1, 8, 0, 1, 2, 2, 11, 4
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283978.
Cf. A283973 (positions of zeros), A283974 (nonzeros).

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[BitAnd[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, 120, print1(bitand(A(n - 1), A(n)),", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283988(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))) if n>1 else 0 # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283988 n) (A004198bi (A002487 (- n 1)) (A002487 n)))  ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).
a(n) = A283986(n) - A283987(n).
a(n) = A007306(n) - A283986(n) = (A007306(n) - A283987(n))/2.
a(n) = A283978((2*n)-1).

A283974 Numbers n for which A002487(n-1) AND A002487(n) > 0 where AND is bitwise-and (A004198).

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 17, 18, 19, 20, 23, 24, 25, 26, 29, 30, 31, 32, 34, 35, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 86, 89, 92, 95, 96, 97, 98, 101, 104, 107, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Comments

Numbers n such that the binary representations of A002487(n-1) and A002487(n) have at least one 1-bit in a common shared position.

Crossrefs

Cf. A283973 (complement).
Positions of nonzeros in A283988.

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Flatten@ Position[Table[BitAnd[a[n - 1], a@ n], {n, 120}], k_ /; k > 0] (* 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)));
    D(n) = if(n<1, 1, sum(k=0, n, binomial(n + k - 1, 2*k)%2))
    for(n=1, 120, if(bitor(A(n - 1), A(n)) != D(n), print1(n, ", "))) \\ Indranil Ghosh, Mar 23 2017
Showing 1-4 of 4 results.