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.

Previous Showing 41-42 of 42 results.

A179461 Decimal expansion of sqrt(51)/7.

Original entry on oeis.org

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

Views

Author

Mark Dols, Jul 14 2010

Keywords

Comments

sqrt(3/2)= sqrt(12/8)= 1.224744... sqrt(51/49)= sqrt(102/98)= 1.0202040612... sqrt (501/499)=sqrt (1002/998)= 1.002002004...

Crossrefs

Programs

Extensions

Keyword:frac replaced by keyword:cons - R. J. Mathar, Jul 20 2010
More terms from Robert G. Wilson v, Aug 23 2010

A384543 Number of distinct values from the bitwise operation i XOR j for all integers i and j in the range [1, n].

Original entry on oeis.org

1, 2, 4, 7, 8, 8, 8, 15, 16, 16, 16, 16, 16, 16, 16, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 127, 128, 128
Offset: 1

Views

Author

DarĂ­o Clavijo, Jun 02 2025

Keywords

Comments

For any n, the maximum value of (i XOR j) is < 2^floor(log_2(n))+1.

Examples

			For n=3, a(3) = 4 because:
 i | j | i XOR j
---+---+-------
 1 | 1 | 0
 1 | 2 | 3
 1 | 3 | 2
 2 | 1 | 3
 2 | 2 | 0
 2 | 3 | 1
 3 | 1 | 2
 3 | 2 | 1
 3 | 3 | 0
In total there are 4 unique values for i XOR j.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := CountDistinct[Flatten[Table[BitXor[i, j], {i, 1, n}, {j, 1, i}]]]; Array[a, 100] (* Amiram Eldar, Jun 02 2025 *)
  • PARI
    a(n) = #setbinop((x,y)->bitxor(x,y), [1..n]); \\ Michel Marcus, Jun 02 2025
  • Python
    def a(n):
        if n < 4: return [1,1,2,4][n]
        k2 = 1 << n.bit_length()
        if (n & (n - 1)) == 0: return k2 - 1
        return k2
    print([a(n) for n in range(1, 68)])
    

Formula

a(2^k) = A000225(k+1) for k > 1.
a(2^k-1) = A151821(k).
a(2^k+1) = A000079(k+1).
a(n) = 2^k if 2^(k-1) < n < 2^k with k=2^floor(log_2(n))+1.
Previous Showing 41-42 of 42 results.