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.

A273106 Numbers representable as ror(k)+rol(k), where ror(k)=A038572(k) is k rotated one binary place to the right, rol(k)=A006257(k) is k rotated one binary place to the left.

Original entry on oeis.org

0, 2, 3, 5, 6, 8, 9, 10, 14, 15, 17, 19, 20, 22, 24, 25, 27, 29, 30, 32, 33, 34, 37, 38, 39, 42, 43, 44, 47, 48, 51, 52, 53, 56, 57, 58, 61, 62, 63, 65, 66, 67, 68, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 95, 96, 98
Offset: 0

Views

Author

Alex Ratushnyak, May 15 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Take[#, 66] &@ Union@ Table[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2] &@ IntegerDigits[n, 2], {n, 0, 10^3}] (* Michael De Vlieger, May 17 2016 *)
  • Python
    def ROR(n):                # returns A038572(n)
        BL = len(bin(n))-2
        return (n>>1) + ((n&1) << (BL-1))
    def ROL(n):                # returns A006257(n) for n>0
        BL = len(bin(n))-2
        return (n*2) - (1<
    				

A273180 Numbers n such that ror(n) + rol(n) is a power of 2, where ror(n)=A038572(n) is n rotated one binary place to the right, rol(n)=A006257(n) is n rotated one binary place to the left.

Original entry on oeis.org

1, 2, 6, 19, 38, 102, 307, 614, 1638, 4915, 9830, 26214, 78643, 157286, 419430, 1258291, 2516582, 6710886, 20132659, 40265318, 107374182, 322122547, 644245094, 1717986918, 5153960755, 10307921510, 27487790694, 82463372083, 164926744166, 439804651110
Offset: 1

Views

Author

Alex Ratushnyak, May 17 2016

Keywords

Crossrefs

Programs

  • C
    #include 
    int main(int argc, char** argv)
    {
      unsigned long long x, n, BL=0;
      for (n=1; n>0; ++n) {
        if ((n & (n-1))==0)  ++BL;
        x = (n>>1) + ((n&1) << (BL-1));   // A038572(n)
        x+= (n*2) - (1ull<A006257(n)  for n>0
        if ((x & (x-1))==0)  printf("%lld, ", n);
      }
    }
    
  • Mathematica
    Select[Range[10^6], IntegerQ@ Log2[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2]] &@ IntegerDigits[#, 2] &] (* or *)
    Rest@ CoefficientList[Series[x (1 + 2 x + 6 x^2 + 2 x^3 + 4 x^4)/((1 - x) (1 + x + x^2) (1 - 16 x^3)), {x, 0, 30}], x] (* Michael De Vlieger, May 19 2016 *)
  • PARI
    Vec(x*(1+2*x+6*x^2+2*x^3+4*x^4)/((1-x)*(1+x+x^2)*(1-16*x^3)) + O(x^50)) \\ Colin Barker, May 19 2016

Formula

From Colin Barker, May 19 2016: (Start)
a(n) = 17*a(n-3) - 16*a(n-6) for n>6.
G.f.: x*(1+2*x+6*x^2+2*x^3+4*x^4) / ((1-x)*(1+x+x^2)*(1-16*x^3)).
(End)

A274133 Numbers representable as ror(x)+rol(x) in two or more ways, where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left.

Original entry on oeis.org

2, 9, 14, 15, 20, 27, 32, 37, 42, 47, 52, 57, 62, 129, 134, 139, 144, 149, 154, 159, 164, 169, 174, 179, 184, 189, 194, 195, 199, 200, 204, 205, 209, 210, 214, 215, 219, 220, 224, 225, 229, 230, 234, 235, 239, 240, 244, 245, 249, 250, 254, 255, 260, 265, 270, 275
Offset: 1

Views

Author

Alex Ratushnyak, Jun 10 2016

Keywords

Comments

These are the duplicates in A273105.

Examples

			ror(5) + rol(5) = 6 + 3 = 9, and also ror(16) + rol(16) = 8 + 1 = 9, therefore 9 is in the sequence.
		

Crossrefs

A274341 Numbers that cannot be represented as ror(x)+rol(x), where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left.

Original entry on oeis.org

1, 4, 7, 11, 12, 13, 16, 18, 21, 23, 26, 28, 31, 35, 36, 40, 41, 45, 46, 49, 50, 54, 55, 59, 60, 64, 69, 74, 79, 84, 89, 94, 97, 102, 107, 112, 117, 122, 127, 131, 132, 136, 137, 141, 142, 146, 147, 151, 152, 156, 157, 161, 162, 166, 167, 171, 172, 176, 177, 181
Offset: 1

Views

Author

Alex Ratushnyak, Jun 26 2016

Keywords

Comments

Numbers that are not in A273105.

Crossrefs

Showing 1-4 of 4 results.