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.

A272919 Numbers of the form 2^(n-1)*(2^(n*m)-1)/(2^n-1), n >= 1, m >= 1.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 15, 16, 31, 32, 36, 42, 63, 64, 127, 128, 136, 170, 255, 256, 292, 511, 512, 528, 682, 1023, 1024, 2047, 2048, 2080, 2184, 2340, 2730, 4095, 4096, 8191, 8192, 8256, 10922, 16383, 16384, 16912, 18724, 32767, 32768, 32896, 34952, 43690, 65535, 65536, 131071
Offset: 1

Views

Author

Ivan Neretin, May 10 2016

Keywords

Comments

In other words, numbers whose binary representation consists of one or more repeating blocks with only one 1 in each block.
Also, fixed points of the permutations A139706 and A139708.
Each a(n) is a term of A064896 multiplied by some power of 2. As such, this sequence must also be a subsequence of A125121.
Also the numbers that uniquely index a Haar graph (i.e., 5 and 6 are not in the sequence since H(5) is isomorphic to H(6)). - Eric W. Weisstein, Aug 19 2017
From Gus Wiseman, Apr 04 2020: (Start)
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. This sequence lists all positive integers k such that the k-th composition in standard order is constant. For example, the sequence together with the corresponding constant compositions begins:
0: () 136: (4,4)
1: (1) 170: (2,2,2,2)
2: (2) 255: (1,1,1,1,1,1,1,1)
3: (1,1) 256: (9)
4: (3) 292: (3,3,3)
7: (1,1,1) 511: (1,1,1,1,1,1,1,1,1)
8: (4) 512: (10)
10: (2,2) 528: (5,5)
15: (1,1,1,1) 682: (2,2,2,2,2)
16: (5) 1023: (1,1,1,1,1,1,1,1,1,1)
31: (1,1,1,1,1) 1024: (11)
32: (6) 2047: (1,1,1,1,1,1,1,1,1,1,1)
36: (3,3) 2048: (12)
42: (2,2,2) 2080: (6,6)
63: (1,1,1,1,1,1) 2184: (4,4,4)
64: (7) 2340: (3,3,3,3)
127: (1,1,1,1,1,1,1) 2730: (2,2,2,2,2,2)
128: (8) 4095: (1,1,1,1,1,1,1,1,1,1,1,1)
(End)

Crossrefs

Cf. A137706 (smallest number indexing a new Haar graph).
Compositions in standard order are A066099.
Strict compositions are ranked by A233564.

Programs

  • Maple
    N:= 10^6: # to get all terms <= N
    R:= select(`<=`,{seq(seq(2^(n-1)*(2^(n*m)-1)/(2^n-1), m = 1 .. ilog2(2*N)/n), n = 1..ilog2(2*N))},N):
    sort(convert(R,list)); # Robert Israel, May 10 2016
  • Mathematica
    Flatten@Table[d = Reverse@Divisors[n]; 2^(d - 1)*(2^n - 1)/(2^d - 1), {n, 17}]

Formula

From Gus Wiseman, Apr 04 2020: (Start)
A333381(a(n)) = A027750(n).
For n > 0, A124767(a(n)) = 1.
If n is a power of two, A333628(a(n)) = 0, otherwise = 1.
A333627(a(n)) is a power of 2.
(End)

A139708 Take n in binary. Rotate the binary digits to the left until a 1 once again appears as the leftmost digit. Convert back into decimal for a(n).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 12, 10, 14, 9, 11, 13, 15, 16, 24, 20, 28, 18, 22, 26, 30, 17, 19, 21, 23, 25, 27, 29, 31, 32, 48, 40, 56, 36, 44, 52, 60, 34, 38, 42, 46, 50, 54, 58, 62, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 64, 96, 80, 112, 72, 88, 104, 120
Offset: 1

Views

Author

Leroy Quet, Apr 30 2008

Keywords

Comments

This sequence written in binary is A139709.
This is a permutation of the positive integers. A139706 is the inverse permutation.
Moreover, the first 2^n terms are a permutation of the first 2^n positive integers. Fixed points of the permutation are A272919. - Ivan Neretin, May 10 2016

References

  • Lionel Levine, Fractal sequences and restricted Nim, Ars Combin. 80 (2006), 113-127.

Crossrefs

Cf. A139706 (inverse), A139709 (in binary), A272919 (fixed points).

Programs

  • Maple
    A139708 := proc(n) local a; a := ListTools[Rotate](convert(n,base,2),-1) ; while op(-1,a) = 0 do a := ListTools[Rotate](a,-1) ; od: add(op(i,a)*2^(i-1),i=1..nops(a)) : end: seq(A139708(n),n=1..100) ; # R. J. Mathar, May 04 2008
  • Mathematica
    rbd[n_]:=Module[{idn2=RotateLeft[IntegerDigits[n,2]]},While[ idn2[[1]] ==0, idn2= RotateLeft[ idn2]];FromDigits[idn2,2]]; Array[rbd,80] (* Harvey P. Dale, Jun 07 2015 *)
    Table[FromDigits[RotateLeft[d = IntegerDigits[n, 2], Position[Join[d, d], 1][[2, 1]] - 1], 2], {n, 71}] (* Ivan Neretin, May 10 2016 *)
  • PARI
    a(n) = if(bitand(n,n-1)==0, n, my(b=logint(n,2), s=b-logint(n-(1<Andrew Howroyd, Jan 04 2024

Formula

From Mikhail Kurkov, Dec 23 2023: (Start)
a(2^m + k) = f(2^m + f(k)) for m >= 0, 0 <= k < 2^m where f(n) = A059893(n) for n > 0 with f(0) = 0.
a(n) = f(A139706(f(n))). (End)

Extensions

More terms from R. J. Mathar, May 04 2008

A343601 For any positive number n, the ternary representation of a(n) is obtained by right-rotating the ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 5, 8, 9, 12, 21, 10, 13, 22, 19, 14, 23, 18, 15, 24, 11, 16, 25, 20, 17, 26, 27, 36, 63, 30, 37, 64, 57, 38, 65, 28, 39, 66, 31, 40, 67, 58, 41, 68, 55, 42, 69, 32, 43, 70, 59, 44, 71, 54, 45, 72, 33, 46, 73, 60, 47, 74, 29, 48, 75, 34, 49
Offset: 0

Views

Author

Rémy Sigrist, Apr 21 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A343600.

Examples

			The first terms, in base 10 and in base 3, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2       2          2
   3     3      10         10
   4     4      11         11
   5     7      12         21
   6     6      20         20
   7     5      21         12
   8     8      22         22
   9     9     100        100
  10    12     101        110
  11    21     102        210
  12    10     110        101
  13    13     111        111
  14    22     112        211
		

Crossrefs

Cf. A053735, A081604, A139706 (binary variant), A160384, A343600 (inverse).

Programs

  • PARI
    a(n, base=3) = { my (d=digits(n, base)); forstep (k=#d, 2, -1, if (d[k], return (fromdigits(concat(d[k..#d], d[1..k-1]), base)))); n }

Formula

A053735(a(n)) = A053735(n).
A081604(a(n)) = A081604(n).
a^k(n) = n for k = A160384(n) (where a^k denotes the k-th iterate of a).

A139707 Take n in binary. Rotate the binary digits to the right until a 1 once again appears as the leftmost digit. a(n) is result written in binary.

Original entry on oeis.org

1, 10, 11, 100, 110, 101, 111, 1000, 1100, 1010, 1101, 1001, 1110, 1011, 1111, 10000, 11000, 10100, 11001, 10010, 11010, 10101, 11011, 10001, 11100, 10110, 11101, 10011, 11110, 10111, 11111, 100000, 110000, 101000, 110001, 100100, 110010
Offset: 1

Views

Author

Leroy Quet, Apr 30 2008

Keywords

Comments

This sequence written in decimal is A139706.

Examples

			For n = 14: 14 = 1110 in binary. Rotate once to the right, getting 0111. The leftmost digit is a 0, so rotate again to the right, getting 1011. A 1 is the leftmost digit, so stop here. a(14) therefore is 1011 (which is 11 in decimal).
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[NestWhile[RotateRight[#]&,RotateRight[IntegerDigits[n,2]], #[[1]] != 1&]],{n,40}] (* Harvey P. Dale, Oct 26 2016 *)

Extensions

Extended by Ray Chandler, Jul 01 2009

A343603 For any positive number n, the balanced ternary representation of a(n) is obtained by right-rotating the balanced ternary representation of n until a nonzero digit appears again as the leftmost digit; a(0) = 0.

Original entry on oeis.org

0, 1, -2, 3, 4, -7, -8, 11, -6, 9, 12, -5, 10, 13, -22, -25, 32, -21, -26, 33, -20, 29, 34, -19, -24, 35, -18, 27, 36, -17, 30, 37, -16, -23, 38, -15, 28, 39, -14, 31, 40, -67, -76, 95, -66, -79, 96, -65, 86, 97, -64, -75, 98, -63, -80, 99, -62, 87, 100, -61
Offset: 0

Views

Author

Rémy Sigrist, Apr 21 2021

Keywords

Comments

This sequence can be extended to negative indexes by setting a(-n) = -a(n) for any n > 0. We then obtain a permutation of the integers (Z) with inverse A343602 (after a similar extension to negative indexes).

Examples

			The first terms, in base 10 and in balanced ternary (where T denotes the digit -1), are:
  n   a(n)  bter(n)  bter(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2    -2       1T          T1
   3     3       10          10
   4     4       11          11
   5    -7      1TT         T1T
   6    -8      1T0         T01
   7    11      1T1         11T
   8    -6      10T         T10
   9     9      100         100
  10    12      101         110
  11    -5      11T         T11
  12    10      110         101
  13    13      111         111
  14   -22     1TTT        T1TT
  15   -25     1TT0        T01T
		

Crossrefs

Cf. A005812, A065363, A134021, A139706 (binary variant), A343601 (ternary variant), A343602 (inverse).

Programs

  • PARI
    a(n) = { my (d = [], t); while (n, d = concat(t = centerlift(Mod(n,3)), d); n = (n-t)\3); forstep (k=#d, 1, -1, if (d[k], return (fromdigits(concat(d[k..#d], d[1..k-1]), 3)))); return (fromdigits(d, 3)) }

Formula

A065363(a(n)) = A065363(n).
A134021(a(n)) = A134021(n).
a^k(n) = n for k = A005812(n) (where a^k denotes the k-th iterate of a).

A345254 Dispersion of A004754, a rectangular array T(n,k) read by downward antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 7, 16, 17, 18, 11, 12, 32, 33, 34, 19, 20, 13, 64, 65, 66, 35, 36, 21, 14, 128, 129, 130, 67, 68, 37, 22, 15, 256, 257, 258, 131, 132, 69, 38, 23, 24, 512, 513, 514, 259, 260, 133, 70, 39, 40, 25, 1024, 1025, 1026, 515, 516, 261, 134
Offset: 1

Views

Author

J. Parker Shectman, Jun 12 2021

Keywords

Comments

As a sequence, {a(n)} permutes the positive integers. As an array, {T(n,k)} is an interspersion-dispersion or I-D array (refer to Kimberling, 1st linked reference).
The top row of {T(n,k)} is A000079 or powers of two = 1, 2, 4, 8, 16, ....
Except for the leftmost element "1" of the top row, rows of T(n,k) indexed n = 0, 1, 2, ..., consist entirely of even numbers (A005843) for n even and entirely of odd numbers (A005408) for n odd.
The left column (k = 1) of {T(n,k)} comprises a "1" for the top row (n = 0) and A004755(n) = n + 2^(floor(log_2(n)) + 1), for rows n = 1, 2, 3, ....
For rows indexed n = 0, 1, 2, ..., and columns indexed k = 1, 2, 3, ..., T(n,k) is given by T(0,k) = L^(k - 1)(1) and T(n,k) = L^(k - 1) R(n) for n = 1, 2, 3, ..., the image of n under a composition of branching functions L(n) = A004754(n) = n + 2^floor(log_2(n)) and R(n) = A004755(n) = n + 2^(floor(log_2(n)) + 1) (cf. generating tree A059893 and 2nd linked reference).
(Duality with array A054582): Consider A059893 and A000027 as labeled binary trees arranging the positive integers. In latter tree, node labels equal node positions, thus following their natural order. Rows of {T(n,k)} are the labels along maximal straight paths that always branch left in the former tree, while rows of (transposed) array A054582 are the labels along maximal straight paths that always branch left in the latter tree.
Column k of {T(n,k)} comprises the (sorted) labels in the k-th right clade of latter tree, while column k of (transposed) A054582 comprises the (sorted) labels in the k-th right clade of the former tree. This makes the arrays {T(n,k)} and (transposed) A054582 "blade-duals," blade being a contraction of branch-clade ('right clades' explained under tree A345253 and in 2nd link).
Write the positive integers in natural order as a (left-justified) "tetrangle" or "irregular triangle" tableau with 2^t entries on each row t, for t=1, 2, 3, .... Then, columns of the tableau equal rows of {T(n,k)} (2nd link):
1,
2, 3,
4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
...
Analogous to A345252, its right-justified tableau of the positive integers in cohorts with lengths the Fibonacci numbers replaced by the above left-justified tableau with powers of two as lengths of the cohorts.
(Mirror duality): A "mirror dual" I-D array or "inverse I-D array" (see Kimberling, 1st linked reference) is obtained by substituting the left-justified tableau by a right-justified tableau and following the identical procedure, or equivalently by mirroring the tree A059893 cited above, i.e., taking maximal straight paths that always branch right in the tree A059893. With two types of duality then, {T(n,k)} forms a quartet of I-D arrays together with its mirror dual, its blade dual (transposed) A054582 and mirror dual A191448 of the latter.
(Para-sequences): Sequences of row and column indices (see Conway-Sloane correspondence under A019586, citing Kimberling). For rows indexed n = 0, 1, 2, ..., and columns indexed k = 1, 2, 3, ..., the row index n of positive integer T(n,k) is A053645(T) and the column index k of positive integer T(n,k) is A065120(T).

Examples

			Northwest corner of {T(n,k)}:
       k=1   k=2    k=3     k=4      k=5       k=6
  n=0:   1,    2,     4,      8,      16,       32, ...
  n=1:   3,    5,     9,     17,      33,       65, ...
  n=2:   6,   10,    18,     34,      66,      130, ...
  n=3:   7,   11,    19,     35,      67,      131, ...
  n=4:  12,   20,    36,     68,     132,      260, ...
  ...
Northwest corner of {T(n,k)} in base-2:
        k=1  k=2    k=3     k=4      k=5       k=6
  n=0:  1,   10,    100,    1000,    10000,    100000, ...
  n=1:  11,  101,   1001,   10001,   100001,   1000001, ...
  n=2:  110, 1010,  10010,  100010,  1000010,  10000010, ...
  n=3:  111, 1011,  10011,  100010,  1000011,  10000011, ...
  n=4:  1100,10100, 100100, 1000100, 10000100, 100000100, ...
  ...
		

Crossrefs

Programs

  • Mathematica
    (*Simplified Formula*)
    MatrixForm[Prepend[Table[n + 2^(Floor[Log[2, n]] + k), {n, 1, 4}, {k, 1, 6}], Table[2^(k - 1), {k, 1, 6}]]]
    (*Branching Formula*)
    MatrixForm[Prepend[Table[NestList[Function[# + 2^(Floor[Log[2, #]])], n + 2^(Floor[Log[2, n]] + 1), 5], {n, 1, 4}], NestList[Function[# + 2^(Floor[Log[2, #]])], 1, 5]]]
  • PARI
    T(n, k) = if (n==0, 2^(k-1), n + 2^(log(n)\log(2) + k));
    matrix(7, 7, n, k, n--; T(n, k)) \\ Michel Marcus, Jul 30 2021

Formula

T(0,k) = 2^(k - 1) and T(n,k) = n + 2^(floor(log_2(n)) + k) for n >= 1.
T(0,k) = L^(k - 1)(1) and T(n,k) = L^(k - 1) R(n) for n = 1, 2, 3, ..., where L(n) = A004754(n) = n + 2^floor(log_2(n)) and R(n) = A004755(n) = n + 2^(floor(log_2(n)) + 1).
Let b(n) = A054582(n-1). Then for all n >= 1, a(n) = A139706(b(n)) and b(n) = A139708(a(n)).

A378872 Discriminant of the minimal polynomial of a number whose continued fraction expansion has periodic part given by the n-th composition (in standard order).

Original entry on oeis.org

5, 8, 5, 13, 12, 12, 5, 20, 21, 8, 40, 21, 40, 40, 5, 29, 32, 60, 17, 60, 85, 85, 96, 32, 17, 85, 96, 17, 96, 96, 5, 40, 45, 24, 104, 13, 148, 148, 165, 24, 148, 8, 221, 148, 12, 221, 260, 45, 104, 148, 165, 148, 221, 12, 260, 104, 165, 221, 260, 165, 260, 260
Offset: 1

Views

Author

Pontus von Brömssen, Dec 10 2024

Keywords

Comments

Here, the minimal polynomial is required to have integer coefficients with no common divisors.
If two numbers have eventually periodic continued fraction expansions with the same periodic part, the discriminants of their respective minimal polynomials are the same.

Examples

			For n = 6, the 5th composition is (1,2). The value of the continued fraction 1+1/(2+1/(1+1/(2+...))) is (1+sqrt(3))/2, whose minimal polynomial is 2*x^2-2*x-1 with discriminant a(6) = 12.
		

Crossrefs

Cf. A059893, A066099 (compositions in standard order), A139706, A246903, A246921, A305311, A378873, A378874.

Formula

a(n) = A378873(n)*A378874(n)^2.
a(A059893(n)) = a(n), since reversing the periodic part of a continued fraction leaves the discriminant unchanged.
a(A139706(n)) = a(n), since a circular shift of the periodic part of a continued fraction leaves the discriminant unchanged.
Showing 1-7 of 7 results.