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.

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

A283973 Numbers n such that A007306(n) = A283986(n); positions of zeros in A283988.

Original entry on oeis.org

1, 3, 4, 9, 10, 12, 13, 15, 16, 21, 22, 27, 28, 33, 36, 37, 48, 49, 60, 61, 64, 78, 84, 85, 87, 88, 90, 91, 93, 94, 99, 100, 102, 103, 105, 106, 108, 109, 115, 129, 130, 133, 135, 136, 141, 144, 145, 153, 159, 160, 162, 171, 172, 189, 190, 192, 193, 195, 196, 213, 214, 223, 225, 226, 232, 240, 241, 244, 249, 250, 252, 255, 256
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Comments

Equally, numbers n for which A007306(n) = A283987(n), or equally, numbers n for which A283986(n) = A283987(n).
Numbers n such that the binary representations of A002487(n-1) and A002487(n) have no 1-bits in common shared positions.

Crossrefs

Cf. A283974 (complement).

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Map[Function[n, If[EvenQ@ n, a[n/2], BitOr[a[#], a[# + 1]] &[(n - 1)/2]]], 2 Range[99] - 1] (* 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)) /* A007306 */
    for(n=1, 300, if(bitor(A(n - 1), A(n)) == D(n), print1(n,", "))) \\ Indranil Ghosh, Mar 23 2017
Showing 1-2 of 2 results.