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.

A220689 Triangular numbers generated in A224218. That is, the triangular numbers generated by the operation triangular(i) XOR triangular(i+1) along increasing i.

Original entry on oeis.org

1, 21, 21, 105, 105, 105, 105, 946, 946, 666, 1653, 666, 1378, 946, 1225, 946, 4005, 1378, 4005, 1378, 7381, 1225, 1378, 1653, 2485, 4005, 31125, 4005, 4005, 4005, 2485, 13861, 13861, 5356, 4005, 7381, 5356, 5356, 7381, 4005, 5356, 29161, 12561, 12561, 4186, 4186, 4186, 4186
Offset: 1

Views

Author

Alex Ratushnyak, Apr 13 2013

Keywords

Crossrefs

Programs

  • Maple
    read("transforms") ;
    A220689 := proc(n)
        i := A224218(n) ;
        XORnos(A000217(i),A000217(i+1)) ;
    end proc: # R. J. Mathar, Apr 23 2013
  • Mathematica
    nmax = 100;
    pmax = 2 nmax^2; (* increase coeff 2 if A224218 is too short *)
    A224218 = Join[{0}, Flatten[Position[Partition[Accumulate[Range[pmax]], 2, 1], _?(OddQ[Sqrt[1 + 8 BitXor[#[[1]], #[[2]]]]]&), {1}, Heads -> False]]];
    a[n_] := Module[{i}, i = A224218[[n]]; BitXor[PolygonalNumber[i], PolygonalNumber[i+1]]];
    Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Aug 07 2023, after Harvey P. Dale in A224218 *)
  • Python
    def rootTriangular(a):
        sr = 1<<33
        while a < sr*(sr+1)//2:
          sr>>=1
        b = sr>>1
        while b:
            s = sr+b
            if a >= s*(s+1)//2:
              sr = s
            b>>=1
        return sr
    for i in range(1<<12):
            s = (i*(i+1)//2) ^ ((i+1)*(i+2)//2)
            t = rootTriangular(s)
            if s == t*(t+1)//2:
                print(str(s), end=',')

Formula

a(n) = A000217(A224218(n)) XOR A000217(A224218(n)+1).