login
This site is supported by donations to The OEIS Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A220518 Numbers n such that A193232(n) is a triangular number. 1
0, 1, 5, 9, 45, 49, 101, 153, 1569, 7163, 7171, 8162, 18974, 18976, 24467, 33490, 60290, 63046, 359539, 551494, 1769418, 2813691, 4140392, 4649729, 6675935, 9653486, 59131393, 158169499, 243345386, 588183781, 1315697727, 1387290631, 1522472645, 1879098546 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Numbers k such that bitwise XOR of first k triangular numbers is a triangular number.

LINKS

Table of n, a(n) for n=1..34.

PROG

(C)

#include <stdio.h>

typedef unsigned long long U64;

U64 rootTriangular(U64 a) {

    U64 sr = 1L<<32, s, b;

    if (a < (sr/2)*(sr+1)) {

      sr>>=1;

      while (a < sr*(sr+1)/2)  sr>>=1;

    }

    for (b = sr>>1; b; b>>=1) {

        s = sr+b;

        if (a >= s*(s+1)/2)  sr = s;

    }

    return sr;

}

int main() {

  U64 a=0, i, t;

  for (i=0; i < 1L<<32; ++i) {

      a ^= i*(i+1)/2;

      t = rootTriangular(a);

      if (a == t*(t+1)/2)  printf("%llu\n", i);

  }

  return 0;

}

CROSSREFS

Cf. A193232.

Cf. A145827 (bitwise XOR of first k squares is a square).

Sequence in context: A226065 A321718 A304127 * A145031 A121724 A149496

Adjacent sequences:  A220515 A220516 A220517 * A220519 A220520 A220521

KEYWORD

base,nonn

AUTHOR

Alex Ratushnyak, Mar 27 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 10 00:54 EST 2019. Contains 329885 sequences. (Running on oeis4.)