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-4 of 4 results.

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

A220698 Indices of triangular numbers generated in A224218.

Original entry on oeis.org

1, 6, 6, 14, 14, 14, 14, 43, 43, 36, 57, 36, 52, 43, 49, 43, 89, 52, 89, 52, 121, 49, 52, 57, 70, 89, 249, 89, 89, 89, 70, 166, 166, 103, 89, 121, 103, 103, 121, 89, 103, 241, 158, 158, 91, 91, 91, 91, 241, 166, 166, 103, 121, 103, 103, 121, 103, 121, 225, 225, 497, 216, 334
Offset: 1

Views

Author

Alex Ratushnyak, Apr 13 2013

Keywords

Comments

Indices of triangular numbers in A220689. That is, S = triangular(i) XOR triangular(i+1); increment i; if S is a triangular number then index of S is appended to a(n). Initially i=0. XOR is the binary logical exclusive-or operator.

Crossrefs

Programs

  • Maple
    A220698 := proc(n)
        A127648(A220689(n)-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, t}, i = A224218[[n]]; t = BitXor[PolygonalNumber[i], PolygonalNumber[i + 1]]; (Sqrt[8 t + 1] - 1)/2];
    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(t), end=',')

Formula

a(n) = i where A000217(i) = A220689(n).

A220752 Terms of A220698 that appear in A224218.

Original entry on oeis.org

3854, 3854, 3035, 3035, 3035, 3035, 3854, 4644, 4644, 4644, 4644, 4644, 3854, 15846, 4644, 4644, 4644, 4644, 4644, 22918, 15846, 15846, 10225, 10225, 10225, 10225, 15846, 22918, 15846, 13364, 13364, 13364, 13364, 10225, 10225, 10225, 10225, 15846, 13364, 13364, 22918, 45012
Offset: 1

Views

Author

Alex Ratushnyak, Apr 13 2013

Keywords

Comments

Terms of A220698 excluding terms that do not appear in A224218.
Indices of XOR-positive triangular numbers such that the generated triangular number is also XOR-positive (definition: triangular(i) is XOR-positive if triangular(i) XOR triangular(i+1) = triangular(k) for some k). XOR is the bitwise logical exclusive-or operator.
Conjecture: the sequence is infinite.
The subsequence with only odd terms begins: 3035, 3035, 3035, 3035, 10225, 10225, 10225, 10225, 10225, 10225, 10225, 10225, 171449, 171449, 236985, 171449, 339249.

Crossrefs

Programs

  • C
    #include 
    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, n, r, t;
      for (n=0; n < (1L<<32)-1; n++) {
        a = (n*(n+1)/2) ^ ((n+1)*(n+2)/2);
        t = rootTriangular(a);
        if (a == t*(t+1)/2) {
            a ^= (t+1)*(t+2)/2;
            r = rootTriangular(a);
            if (a == r*(r+1)/2)  printf("%llu, ", t);
        }
      }
    }

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=', ')
Showing 1-4 of 4 results.