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.

A226471 Numbers n such that n^2 XOR triangular(n) is a triangular number. XOR is the bitwise logical exclusive-or operator.

Original entry on oeis.org

0, 1, 3, 7, 15, 25, 31, 63, 113, 127, 189, 200, 255, 381, 481, 499, 511, 765, 1004, 1011, 1023, 1533, 1785, 1808, 1985, 2023, 2035, 2047, 3069, 3199, 3255, 3577, 3810, 4071, 4083, 4095, 4446, 6141, 6399, 7161, 8065, 8135, 8167, 8179, 8191, 12285, 12799, 14279, 14280
Offset: 1

Views

Author

Alex Ratushnyak, Jun 08 2013

Keywords

Comments

Indices of triangular numbers in A226470. Numbers n such that A226470(n) and A226470(n+1) are triangular numbers: 0, 14279, 491279, 16251935, 29358023, 528478271, ...

Crossrefs

Programs

  • Mathematica
    Select[Range[0,15000],OddQ[Sqrt[8*BitXor[#^2,(#(#+1))/2]+1]]&] (* Harvey P. Dale, Jul 22 2024 *)
  • Python
    import math
    for n in range(100000000):
      a = (n*n) ^ (n*(n+1)//2)
      r = int(math.sqrt(a*2))
      if r*(r+1)==a*2: print(n, end=', ')

A226472 Numbers n such that n^2 XOR triangular(n) is a perfect square. XOR is the bitwise logical exclusive-or operator.

Original entry on oeis.org

0, 1, 6, 8, 4086, 24136, 162297, 7868054, 29792904, 22666693375
Offset: 1

Views

Author

Alex Ratushnyak, Jun 08 2013

Keywords

Comments

Indices of perfect squares in A226470. No other terms below 2^35. Roots of generated squares: 0, 0, 7, 10, 2915, 29506, 149434, 6328037, 27602118, 20243443647.

Examples

			8^2 XOR triangular(8) = 64 XOR 36 = 100, because 100 is a perfect square, 8 is in the sequence.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    int main() {
      for (unsigned long long a, r, n=0; n < (1ULL<<32); ++n) {
        a = (n*n) ^ (n*(n+1)/2);
        r = sqrt(a);
        if (r*r==a)  printf("%llu, ", n);
      }
      return 0;
    }
Showing 1-2 of 2 results.