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.

A088163 Numbers for which rotating one binary place to the right less rotating one binary place to the left is equal to zero.

Original entry on oeis.org

0, 1, 2, 3, 7, 10, 15, 31, 42, 63, 127, 170, 255, 511, 682, 1023, 2047, 2730, 4095, 8191, 10922, 16383, 32767, 43690, 65535, 131071, 174762, 262143, 524287, 699050, 1048575, 2097151, 2796202, 4194303, 8388607, 11184810, 16777215, 33554431, 44739242, 67108863
Offset: 0

Views

Author

Robert G. Wilson v, Sep 13 2003

Keywords

Comments

n is a member iff n is of the form 2^n -1 (A000225) or A000975(2n).

Crossrefs

Programs

  • Mathematica
    f[n_] := FromDigits[ RotateRight[ IntegerDigits[n, 2]], 2] - FromDigits[ RotateLeft[ IntegerDigits[n, 2]], 2]; Select[ Range[33560000], f[ # ] == 0 &]
    (* Or *) Union[ Join[ Table[2^n - 1, {n, 0, 25}], Table[ Ceiling[2(2^n - 1)/3], {n, 2, 24, 2}]]]
    LinearRecurrence[{0,0,5,0,0,-4},{0,1,2,3,7,10},40] (* Harvey P. Dale, Feb 20 2022 *)
  • PARI
    concat(0, Vec(x*(1+x)*(1+x+2*x^2) / ((1-x)*(1+x+x^2)*(1-4*x^3)) + O(x^50))) \\ Colin Barker, May 14 2016

Formula

Numbers n such that A038572(n) - A006257(n) = A088161(n) = 0.
From Colin Barker, May 14 2016: (Start)
a(n) = 5*a(n-3)-4*a(n-6) for n>5.
G.f.: x*(1+x)*(1+x+2*x^2) / ((1-x)*(1+x+x^2)*(1-4*x^3)).
(End)

A273105 a(n) = A038572(n) + A006257(n), sum of the two numbers obtained by rotating the binary representation of n by one place to the right and to the left.

Original entry on oeis.org

0, 2, 2, 6, 3, 9, 8, 14, 5, 15, 10, 20, 15, 25, 20, 30, 9, 27, 14, 32, 19, 37, 24, 42, 29, 47, 34, 52, 39, 57, 44, 62, 17, 51, 22, 56, 27, 61, 32, 66, 37, 71, 42, 76, 47, 81, 52, 86, 57, 91, 62, 96, 67, 101, 72, 106, 77, 111, 82, 116, 87, 121, 92, 126, 33, 99
Offset: 0

Views

Author

Alex Ratushnyak, May 15 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[RotateRight@ #, 2] + FromDigits[RotateLeft@ #, 2] &@ IntegerDigits[n, 2], {n, 0, 65}] (* Michael De Vlieger, May 17 2016 *)
  • Python
    print('0', end=',')
    for n in range(1,1000):
        BL = len(bin(n))-2
        x = (n>>1) + ((n&1) << (BL-1))   # A038572(n)
        x+= (n*2) - (1<A006257(n)  for n>0
        print(str(x), end=',')

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