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

A224511 Roots of squares generated in A221643. That is, S = i^2 XOR (i+1)^2; increment i; if S is a square then square root of S is appended to a(n). Initially i=0. XOR is the binary logical exclusive-or operator.

Original entry on oeis.org

1, 5, 3, 9, 7, 13, 11, 21, 17, 15, 43, 45, 29, 19, 41, 25, 23, 59, 39, 27, 35, 33, 31, 85, 37, 61, 51, 53, 47, 81, 79, 49, 55, 121, 83, 75, 57, 73, 77, 67, 65, 63, 71, 69, 125, 89, 87, 123, 105, 107, 95, 101, 163, 93, 91, 99, 97, 349, 243, 103, 169, 109, 233, 115, 119, 171
Offset: 1

Views

Author

Alex Ratushnyak, Apr 08 2013

Keywords

Comments

Conjecture: this is a permutation of odd numbers.
b(n) = (a(n)-1)/2 begins: 0, 2, 1, 4, 3, 6, 5, 10, 8, 7, 21, 22, 14, 9, 20, 12, 11, 29, 19, 13, 17.

Crossrefs

Programs

  • Python
    import math
    for i in range(1<<16):
        s = (i*i) ^ ((i+1)*(i+1))
        r = int(math.sqrt(s));
        if s == r*r:
            print(r, end=', ')

A224218 Indices of XOR-positive triangular numbers. That is, numbers n such that triangular(n) XOR triangular(n+1) is a triangular number, where XOR is the bitwise logical XOR operator.

Original entry on oeis.org

0, 12, 18, 24, 40, 86, 102, 177, 333, 357, 628, 665, 669, 689, 840, 845, 860, 861, 1124, 1185, 1196, 1206, 1377, 1418, 1706, 1890, 1906, 1956, 2138, 2204, 2388, 2524, 2588, 2843, 2970, 2994, 3035, 3107, 3154, 3234, 3299, 3606, 3824, 3854, 4005, 4021, 4169, 4185, 4568, 4580
Offset: 1

Views

Author

Alex Ratushnyak, Apr 01 2013

Keywords

Comments

Generated triangular numbers: A220689(n) = A000217(a(n)) XOR A000217(a(n)+1).
Indices of triangular numbers in A220689: A220698.
Terms of A220698 that appear in this sequence: A220752.

Examples

			Triangular(18) XOR triangular(19) = 171 XOR 190 = 21, because 21 is a triangular number, 18 is in the sequence.
		

Crossrefs

Programs

  • Maple
    read("transforms") ;
    isA000217 := proc(n)
        local t1;
        t1:=floor(sqrt(2*n));
        if n = t1*(t1+1)/2 then
            return true
        else
            return false;
        end if;
    end proc:
    isA224218 := proc(n)
        XORnos(A000217(n),A000217(n+1)) ;
        isA000217(%) ;
    end proc:
    A224218 := proc(n)
        option remember;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA224218(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Apr 23 2013
  • Mathematica
    Join[{0},Flatten[Position[Partition[Accumulate[Range[5000]],2,1],?(OddQ[ Sqrt[1+8BitXor[#[[1]],#[[2]]]]]&),{1},Heads->False]]] (* _Harvey P. Dale, Dec 05 2014 *)
  • 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(i), end=',')

A224515 a(n) = least k such that sqrt(k^2 XOR (k+1)^2) = 2*n+1, a(n) = -1 if there is no such k.

Original entry on oeis.org

0, 4, 3, 24, 23, 44, 43, 112, 111, 180, 76, 264, 248, 348, 164, 480, 479, 411, 611, 327, 183, 115, 139, 943, 1103, 747, 787, 1111, 1447, 323, 699, 1984, 1983, 1851, 2243, 2008, 1576, 1388, 1684, 1072, 976, 1268, 499, 3383, 3271, 4124, 4068, 3679, 4511, 4315, 3804, 4999
Offset: 0

Views

Author

Alex Ratushnyak, Apr 08 2013

Keywords

Comments

Conjectures:
1. a(n) >= 0.
2. Least k is also the only such k.
If both conjectures are true, then the sequence is a permutation of A221643.

Crossrefs

Cf. A221643.

Programs

  • Mathematica
    a[n_] := For[k=0, k <= 3*n^2+1, k++, If[ Sqrt[ BitXor[k^2, (k+1)^2]] == 2*n+1, Return[k]]] /. Null -> -1; a /@ Range[0, 51] (* Jean-François Alcover, Jun 05 2013 *)
  • PARI
    a(n)=my(k=sqrtint(2*n^2),t);while(!issquare(bitxor(k^2,(k+1)^2),&t)||t!=2*n+1,k++);k \\ Charles R Greathouse IV, Jun 05 2013
  • Python
    import math
    needTerms = n = 1024
    i = 0
    terms = [-1] * n
    while n:
      s = (i*i) ^ ((i+1)*(i+1))
      r = int(math.sqrt(s))
      if s == r*r:
        if (r&1)==0:  break
        r = (r-1)//2
        if r < needTerms:
            if terms[r] >= 0:  break
            terms[r] = i
            n -= 1
      i += 1
    if n:  print('Error')
    else:
      for i in range(needTerms):
        t = terms[i]
        print(t, end=', ') # math.sqrt((t*t) ^ ((t+1)*(t+1)))
    

A224241 Numbers k such that k^2 XOR (k+1)^2 is a square, and k^2 XOR (k+2)^2 is also a square, where XOR is the bitwise logical exclusive-or operator.

Original entry on oeis.org

0, 3, 130456, 342096, 1226720, 291575011, 379894587, 523040160, 15216609776, 136622606520
Offset: 1

Views

Author

Alex Ratushnyak, Apr 01 2013

Keywords

Comments

A subsequence of A221643.
Conjecture: the sequence is infinite.

Crossrefs

Cf. A221643.

Programs

  • C
    #include 
    #include 
    int main() {
      unsigned long long a, i, t;
      for (i=0; i < (1L<<32)-2; ++i) {
          a = (i*i) ^ ((i+1)*(i+1));
          t = sqrt(a);
          if (a != t*t) continue;
          a = (i*i) ^ ((i+2)*(i+2));
          t = sqrt(a);
          if (a != t*t) continue;
          printf("%llu, ", i);
      }
      return 0;
    }
    
  • Java
    class A224241 {
            static public BigInteger isqrt(final BigInteger n)
            {
                    if ( n.compareTo(BigInteger.ZERO) < 0 )
                            throw new ArithmeticException("Negative argument "+ n.toString()) ;
                    BigInteger x  ;
                    final int bl = n.bitLength() ;
                    if ( bl > 120)
                            x = n.shiftRight(bl/2-1) ;
                    else
                    {
                            final double resul= Math.sqrt(n.doubleValue()) ;
                            x = new BigInteger(""+Math.round(resul)) ;
                    }
                    final BigInteger two = new BigInteger("2") ;
                    while ( true)
                    {
                            BigInteger x2 = x.pow(2) ;
                            BigInteger xplus2 = x.add(BigInteger.ONE).pow(2) ;
                            if ( x2.compareTo(n) <= 0 && xplus2.compareTo(n) > 0)
                                    return x ;
                            xplus2 = xplus2.subtract(x.shiftLeft(2)) ;
                            if ( xplus2.compareTo(n) <= 0 && x2.compareTo(n) > 0)
                                    return x.subtract(BigInteger.ONE) ;
                            xplus2 = x2.subtract(n).divide(x).divide(two) ;
                            x = x.subtract(xplus2) ;
                    }
            }
        static public void main(String[] argv)
        {
            for(BigInteger k = BigInteger.ZERO ;  ; k= k.add(BigInteger.ONE) )
            {
                final BigInteger k2 = k.pow(2) ;
                final BigInteger kplus1 = k.add(BigInteger.ONE) ;
                final BigInteger k12 = kplus1.pow(2) ;
                final BigInteger xor1 = k2.xor(k12) ;
                final BigInteger roo1 = isqrt(xor1) ;
                if ( roo1.pow(2).compareTo(xor1) == 0 )
                {
                    final BigInteger k22 = kplus1.add(BigInteger.ONE).pow(2) ;
                    final BigInteger xor2 = k2.xor(k22) ;
                    final BigInteger roo2 = isqrt(xor2) ;
                    if ( roo2.pow(2).compareTo(xor2) == 0 )
                        System.out.println(k) ;
                }
            }
        }
    }
    // R. J. Mathar, Apr 25 2013

A224242 Numbers k such that k^2 XOR (k+1)^2 is a square, and k^2 XOR (k-1)^2 is a square, where XOR is the bitwise logical XOR operator.

Original entry on oeis.org

0, 4, 24, 44, 112, 480, 1984, 8064, 32512, 130560, 263160, 278828, 340028, 523264, 2095104, 8384512, 25239472, 32490836, 33546240, 134201344, 536838144, 2147418112
Offset: 1

Views

Author

Alex Ratushnyak, Apr 01 2013

Keywords

Comments

A subsequence of A221643: k's such that A221643(k) = A221643(k-1) + 1.
A059153 is a subsequence. Terms that are not in A059153: 0, 44, 263160, 278828, 340028, 25239472, 32490836. Conjecture: the subsequence of non-A059153 terms is infinite.

Crossrefs

Programs

  • C
    #include 
    #include 
    int main() {
      unsigned long long a, i, t;
      for (i=0; i < (1L<<32)-1; ++i) {
          a = (i*i) ^ ((i+1)*(i+1));
          t = sqrt(a);
          if (a != t*t) continue;
          a = (i*i) ^ ((i-1)*(i-1));
          t = sqrt(a);
          if (a != t*t) continue;
          printf("%llu, ", i);
      }
      return 0;
    }
  • Mathematica
    Select[Range[0,84*10^5],AllTrue[{Sqrt[BitXor[#^2,(#+1)^2]],Sqrt[BitXor[#^2,(#-1)^2] ]},IntegerQ]&] (* The program generates the first 16 terms of the sequence. *) (* Harvey P. Dale, Nov 10 2022 *)

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;
    }

A261808 Numbers n such that n^2 XOR n^3 is a square, where XOR is the bitwise XOR operator.

Original entry on oeis.org

0, 1, 5, 8, 17, 37, 48, 65, 257, 288, 1025, 1088, 2305, 4097, 4224, 4357, 9217, 12320, 16385, 16640, 20737, 25920, 36865, 50624, 65537, 66048, 147457, 229440, 262145, 263168, 264197, 295937, 589825, 1048577, 1050624, 1052677, 2166785, 2359297, 4194305, 4198400, 4202501
Offset: 1

Views

Author

Alex Ratushnyak, Sep 01 2015

Keywords

Crossrefs

Cf. A221643.

Programs

  • Mathematica
    Select[Range[0, 100000], IntegerQ@ Sqrt@ BitXor[#^2, #^3] &] (* Michael De Vlieger, Sep 01 2015 *)
  • PARI
    is(n)=issquare(bitxor(n^2,n^3)) \\ Anders Hellström, Sep 01 2015
Showing 1-7 of 7 results.