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.

User: Gage Schacher

Gage Schacher's wiki page.

Gage Schacher has authored 2 sequences.

A336953 In binary representation, rotate the digits of n right n places.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 6, 7, 8, 12, 10, 7, 12, 14, 11, 15, 8, 12, 10, 7, 20, 26, 21, 30, 17, 25, 13, 30, 19, 27, 30, 31, 8, 12, 10, 7, 36, 50, 41, 60, 34, 19, 42, 53, 11, 45, 58, 31, 48, 56, 44, 30, 19, 43, 54, 59, 14, 15, 43, 55, 60, 62, 47, 63, 32, 48, 40, 28
Offset: 0

Author

Gage Schacher, Aug 08 2020

Keywords

Comments

On the graph, there are a series of larger and larger parallelograms joined together by a straight line on y=x where n is unchanged, mostly in the case where n is a multiple of the bit length of n. In addition to the main line that cuts through the graph, each parallelogram has the same few sloped lines in its borders.

Examples

			a(3) = a('11') = '11' = 3;
a(4) = a('100') = '010' = '10' = 2;
a(5) = a('101') = '011' = '11' = 3;
		

Crossrefs

Cf. A007088, A038572 (rotated one binary place to the right).
Cf. A366139 (rotate left), A366140 (fixed points).

Programs

  • Mathematica
    Array[FromDigits[RotateRight[IntegerDigits[#, 2], #], 2] &, 68, 0] (* Michael De Vlieger, Oct 05 2020 *)
  • PARI
    a(n) = my(d=binary(n)); for (k=1, n, d = concat(d[#d], d[1..#d-1])); fromdigits(d, 2); \\ Michel Marcus, Aug 09 2020
    
  • Python
    def A336953(n):
        if n == 0: return 0
        l, m = -(n%n.bit_length()), bin(n)[2:]
        return int(m[l:]+m[:l],2) # Chai Wah Wu, Jan 22 2023

A336823 a(1)=1; thereafter a(n) = a(n-1) / wt(n-1) if wt(n-1) divides a(n-1), otherwise a(n) = a(n-1) * wt(n-1) where wt(n) is the binary weight of n.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 6, 6, 3, 6, 2, 1, 3, 1, 4, 4, 2, 1, 3, 6, 2, 6, 24, 12, 4, 12, 3, 1, 4, 1, 5, 5, 10, 5, 15, 30, 10, 30, 120, 60, 20, 60, 15, 5, 20, 5, 1, 2, 6, 2, 8, 24, 6, 24, 120, 40, 10, 40, 8, 2, 10, 2, 12, 12, 6, 3, 1, 2, 6, 2, 8, 4, 12, 4, 1, 3, 12
Offset: 1

Author

Gage Schacher, Aug 04 2020

Keywords

Examples

			a(1)=1 is given, and has 1, the binary weight of 1, as a factor so a(2) =1/1=1;
a(2)=1 which has 1, the binary weight of 2, as a factor so a(3) =1/1=1;
a(3)=1 which does not have 2, the binary weight of 3, as a factor so a(4) =1*2=2.
		

Crossrefs

Cf. A000120 (binary weight), A326889.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[Divisible[a[n-1], (w = DigitCount[n-1, 2, 1])], a[n-1] / w, a[n-1] * w]; Array[a, 100] (* Amiram Eldar, Aug 05 2020 *)
  • PARI
    a(n) = if (n==1, 1, my(h=hammingweight(n-1), last=a(n-1)); if (last%h, last*h, last/h)); \\ Michel Marcus, Aug 05 2020

Formula

a(n) = a(n-1)/A000120(n-1) iff A000120(n-1) is a factor of a(n-1), otherwise a(n) = a(n-1)*A000120(n-1).

Extensions

a(1)=1 added to definition. - N. J. A. Sloane, Sep 21 2020