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-10 of 61 results. Next

A099884 XOR difference triangle of the powers of 2, read by rows; Square array A(row,col): A(0,col) = 2^col, A(row,col) = A048724(A(row-1, col)) for row > 0, read by descending antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 12, 10, 15, 16, 24, 20, 30, 17, 32, 48, 40, 60, 34, 51, 64, 96, 80, 120, 68, 102, 85, 128, 192, 160, 240, 136, 204, 170, 255, 256, 384, 320, 480, 272, 408, 340, 510, 257, 512, 768, 640, 960, 544, 816, 680, 1020, 514, 771, 1024, 1536, 1280, 1920
Offset: 0

Views

Author

Paul D. Hanna, Oct 28 2004

Keywords

Comments

Define an "XOR difference triangle" for a sequence A by the following process. Start with A in the leftmost column. Generate the next column by performing the XOR operation between adjacent terms of the prior column. Repeat this process to generate the XOR difference triangle for A. Further, we define the "XOR BINOMIAL transform" of A as the main diagonal in the XOR difference triangle for A. The XOR BINOMIAL transform is its self-inverse. Let a sequence B be the XOR BINOMIAL transform of A, then we may express B by: B(n) = SumXOR_{k=0..n} A047999(n,k)*A(k), which is equivalent to: B(n) = (C(n,0)mod 2)*A(0) XOR (C(n,1)mod 2)*A(1) XOR (C(n,2)mod 2)*A(2) XOR ... XOR (X(n,n)mod 2)*A(n), where the coefficients are C(n,k)(mod 2) = A047999(n,k).
This sequence is a rearrangement of the numbers which are 2^k times distinct Fermat numbers (numbers of the form 2^(2^m) + 1). This matches the sizes of polygons constructible with compass and straightedge (A003401) up to 2^32+1, which is the first nonprime Fermat number. - Franklin T. Adams-Watters, Jun 16 2006

Examples

			The main diagonal equals A001317 (Pascal's triangle mod 2 in decimal):
{1,3,5,15,17,51,85,255,257,771,1285,3855,...}, and defines the XOR BINOMIAL transform of the powers of 2.
Rows begin:
  1;
  2, 3;
  4, 6, 5;
  8, 12, 10, 15;
  16, 24, 20, 30, 17;
  32, 48, 40, 60, 34, 51;
  64, 96, 80, 120, 68, 102, 85;
  128, 192, 160, 240, 136, 204, 170, 255;
  256, 384, 320, 480, 272, 408, 340, 510, 257;
  512, 768, 640, 960, 544, 816, 680, 1020, 514, 771;
  1024, 1536, 1280, 1920, 1088, 1632, 1360, 2040, 1028, 1542, 1285;
  2048, 3072, 2560, 3840, 2176, 3264, 2720, 4080, 2056, 3084, 2570, 3855;
  ...
From _Antti Karttunen_, Sep 19 2016: (Start)
Viewed as a square array, the top left corner looks like this:
     1,    2,     4,     8,    16,     32,     64,    128
     3,    6,    12,    24,    48,     96,    192,    384
     5,   10,    20,    40,    80,    160,    320,    640
    15,   30,    60,   120,   240,    480,    960,   1920
    17,   34,    68,   136,   272,    544,   1088,   2176
    51,  102,   204,   408,   816,   1632,   3264,   6528
    85,  170,   340,   680,  1360,   2720,   5440,  10880
   255,  510,  1020,  2040,  4080,   8160,  16320,  32640
   257,  514,  1028,  2056,  4112,   8224,  16448,  32896
   771, 1542,  3084,  6168, 12336,  24672,  49344,  98688
  1285, 2570,  5140, 10280, 20560,  41120,  82240, 164480
  3855, 7710, 15420, 30840, 61680, 123360, 246720, 493440
  4369, 8738, 17476, 34952, 69904, 139808, 279616, 559232
  ...
(End)
The square array shown above can be viewed as a subtable of a multiplication table with particular relevance to the carryless multiplication defined by A048720, as the first column gives the A048720 powers of 3 (and the first row gives powers of 2, which are the same as in standard arithmetic). - _Peter Munn_, Jan 13 2020
		

Crossrefs

Essentially GF(2)[X] analog of table A036561. - Antti Karttunen, Jan 18 2020
Cf. A047999, A158875 (row sums).
Cf. A000079 (first column of triangular table, the topmost row of square array).
Cf. A001317 (the rightmost diagonal of triangular table, the leftmost column of square array).
Cf. A099885, A117998 (central diagonals).
Cf. A276618 (transpose), A091202, A193231.

Programs

  • Mathematica
    a[n_]:= Sum[Mod[Binomial[n, i], 2]*2^i, {i, 0, n}]; T[n_, k_]:=2^(n - k)a[k]; Table[T[n, k], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, Apr 11 2017 *)
  • PARI
    {T(n,k)=local(B);B=0;for(i=0,k,B=bitxor(B,binomial(k,i)%2*2^(n-i)));B}
    for(n=0,10,for(k=0,n,print1(T(n,k),", "));print(""))
    
  • Python
    from sympy import binomial
    def a(n):
        return sum((binomial(n, i)%2)*2**i for i in range(n + 1))
    def T(n, k): return 2**(n - k)*a(k)
    for n in range(21): print([T(n, k) for k in range(n + 1)]) # Indranil Ghosh, Apr 11 2017
  • Scheme
    (define (A099884 n) (A099884bi (A002262 n) (A025581 n)))
    ;; Then use either this recurrence:
    (define (A099884bi row col) (if (zero? row) (A000079 col) (A048724 (A099884bi (- row 1) col))))
    ;; or this one:
    (define (A099884bi row col) (if (zero? col) (A001317 row) (* 2 (A099884bi row (- col 1)))))
    ;; Antti Karttunen, Sep 19 2016
    

Formula

T(n, k) = 2^(n-k)*A001317(k). T(n, n) = A001317(n) = SumXOR_{k=0..n} A047999(n, k)*2^k, where SumXOR is the analog of summation under the binary XOR operation.
From Antti Karttunen, Sep 19 2016: (Start)
When viewed as a square array A(row,col), with row >= 0, col >= 0, the following recurrences and formulas are valid:
A(0,col) = A000079(col), for row > 0, A(row,col) = A048724(A(row-1, col)).
A(row,0) = A001317(row), for col > 0, A(row,col) = 2*A(row,col-1).
A(row,col) = A248663(A066117(row+1,col+1)) = A048675(A255483(row,col+1)).
(End)
With the definitions from Antti Karttunen above, A(row+1, col) = A048720(3, A(row, col)). - Peter Munn, Jan 13 2020
A(n,k) = A193231(A(k,n)) = A091202(A036561(n,k)). - Antti Karttunen, Jan 18 2020

Extensions

Square array interpretation added as a second, alternative description by Antti Karttunen, Sep 19 2016

A277820 Square array: A(r,1) = A065621(r); for c > 1, A(r,c) = A048724(A(r,c-1)), read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

1, 3, 2, 5, 6, 7, 15, 10, 9, 4, 17, 30, 27, 12, 13, 51, 34, 45, 20, 23, 14, 85, 102, 119, 60, 57, 18, 11, 255, 170, 153, 68, 75, 54, 29, 8, 257, 510, 427, 204, 221, 90, 39, 24, 25, 771, 514, 765, 340, 359, 238, 105, 40, 43, 26, 1285, 1542, 1799, 1020, 937, 306, 187, 120, 125, 46, 31, 3855, 2570, 2313, 1028, 1275, 854, 461, 136, 135, 114, 33, 28
Offset: 1

Views

Author

Antti Karttunen, Nov 01 2016

Keywords

Comments

For all n >= 1, A277818 (= A268389(n)+1) gives the (one-based) index of the column where n is located in this array, while A268671(n) gives the (one-based) index of the row where it is on.
This array is obtained when one selects from A277320 the columns 1, 3, 5, 15, 17, 51, ..., i.e., those with an index A001317(k).

Examples

			The top left corner of the array:
   1,  3,   5,  15,  17,   51,   85,  255,   257,   771,  1285,  3855
   2,  6,  10,  30,  34,  102,  170,  510,   514,  1542,  2570,  7710
   7,  9,  27,  45, 119,  153,  427,  765,  1799,  2313,  6939, 11565
   4, 12,  20,  60,  68,  204,  340, 1020,  1028,  3084,  5140, 15420
  13, 23,  57,  75, 221,  359,  937, 1275,  3341,  5911, 14649, 19275
  14, 18,  54,  90, 238,  306,  854, 1530,  3598,  4626, 13878, 23130
  11, 29,  39, 105, 187,  461,  599, 1785,  2827,  7453, 10023, 26985
   8, 24,  40, 120, 136,  408,  680, 2040,  2056,  6168, 10280, 30840
  25, 43, 125, 135, 393,  667, 1965, 2295,  6425, 11051, 32125, 34695
  26, 46, 114, 150, 442,  718, 1874, 2550,  6682, 11822, 29298, 38550
  31, 33,  99, 165, 495,  561, 1619, 2805,  7967,  8481, 25443, 42405
  28, 36, 108, 180, 476,  612, 1708, 3060,  7196,  9252, 27756, 46260
  21, 63,  65, 195, 325,  975, 1105, 3315,  5397, 16191, 16705, 50115
  22, 58,  78, 210, 374,  922, 1198, 3570,  5654, 14906, 20046, 53970
  19, 53,  95, 225, 291,  869, 1455, 3825,  4883, 13621, 24415, 57825
  16, 48,  80, 240, 272,  816, 1360, 4080,  4112, 12336, 20560, 61680
  49, 83, 245, 287, 801, 1379, 4005, 4335, 12593, 21331, 62965, 73247
  50, 86, 250, 270, 786, 1334, 3930, 4590, 12850, 22102, 64250, 69390
  55, 89, 235, 317, 839, 1481, 3675, 4845, 14135, 22873, 60395, 80957
		

Crossrefs

Inverse permutation: A277821.
Transpose: A277819.
Row 1: A001317.
Column 1: A065621, column 2: A277823, column 3: A277825.
Other related tables or permutations: A277880, A277901.

Programs

Formula

A(r,1) = A065621(r); for c > 1, A(r,c) = A048724(A(r,c-1)).
A(r,c) = A048675(A277810(r,c)).
As a composition of other permutations:
a(n) = A277901(A277880(n)).

A277823 a(n) = A048724(A065621(n)).

Original entry on oeis.org

3, 6, 9, 12, 23, 18, 29, 24, 43, 46, 33, 36, 63, 58, 53, 48, 83, 86, 89, 92, 71, 66, 77, 72, 123, 126, 113, 116, 111, 106, 101, 96, 163, 166, 169, 172, 183, 178, 189, 184, 139, 142, 129, 132, 159, 154, 149, 144, 243, 246, 249, 252, 231, 226, 237, 232, 219, 222, 209, 212, 207, 202, 197, 192, 323, 326, 329, 332, 343, 338, 349, 344, 363, 366, 353
Offset: 1

Views

Author

Antti Karttunen, Nov 01 2016

Keywords

Crossrefs

Column 2 of A277820.
Column 3 of A277320.

Programs

Formula

a(n) = A048724(A065621(n)).
a(n) = A277320(n,3) = A048720(A065621(n),3).

A048728 Differences between A008585 (multiples of 3) and A048724.

Original entry on oeis.org

0, 0, 0, 4, 0, 0, 8, 12, 0, 0, 0, 4, 16, 16, 24, 28, 0, 0, 0, 4, 0, 0, 8, 12, 32, 32, 32, 36, 48, 48, 56, 60, 0, 0, 0, 4, 0, 0, 8, 12, 0, 0, 0, 4, 16, 16, 24, 28, 64, 64, 64, 68, 64, 64, 72, 76, 96, 96, 96, 100, 112, 112, 120
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Crossrefs

Positions of zeros are given by A003714. Cf. A048735, A242400.
Diagonal 3 of A061858.

Programs

Formula

a(n) = n*3 - Xmult(n, 3).

A246163 Permutation of natural numbers: a(1) = 1, a(A014580(n)) = A065621(1+a(n)), a(A091242(n)) = A048724(a(n)), where A065621(n) and A048724(n) give the reversing binary representation of n and -n, respectively, and A014580 resp. A091242 are the binary coded irreducible resp. reducible polynomials over GF(2).

Original entry on oeis.org

1, 2, 7, 3, 6, 9, 8, 5, 10, 27, 4, 24, 11, 15, 30, 45, 12, 40, 26, 29, 17, 34, 119, 20, 25, 120, 46, 39, 51, 102, 14, 153, 60, 43, 136, 114, 31, 105, 85, 170, 44, 18, 427, 68, 125, 408, 13, 150, 33, 187, 255, 510, 116, 54, 41, 765, 204, 135, 28, 680, 16, 23, 442, 99, 461, 257, 35, 514, 156, 90, 123, 1799, 118, 340, 393, 36
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where the two complementary pairs to be entangled with each other are A014580/A091242 (binary codes for irreducible and reducible polynomials over GF(2)) and A065621/A048724, the latter which themselves are permutations of A000069/A001969 (odious and evil numbers), which means that this permutation shares many properties with A246161.
Because 3 is the only evil number in A014580, it implies that, apart from a(3)=7, odious numbers occur in odious positions only (along with many evil numbers that also occur in odious positions).
Furthermore, all terms of A246158 reside in infinite cycles, and apart from 4 and 8, all of them reside in separate cycles. The infinite cycle containing 4 and 8 goes as: ..., 2091, 97, 47, 13, 11, 4, 3, 7, 8, 5, 6, 9, 10, 27, 46, 408, 2535, ... and it is only because a(3) = 7, that it can temporarily switch back from evil terms to odious terms, until right after a(8) = 5 it is finally doomed to the eternal evilness.
Please see also the comments at A246201 and A246161.

Crossrefs

Inverse: A246164.
Similar or related permutations: A246205, A193231, A246201, A234026, A245701, A234612, A246161, A246203.

Formula

a(1) = 1, and for n > 1, if n is in A014580, a(n) = A065621(1+a(A091226(n))), otherwise a(n) = A048724(a(A091245(n))).
As a composition of related permutations:
a(n) = A193231(A246201(n)).
a(n) = A234026(A245701(n)).
a(n) = A234612(A246161(n)).
a(n) = A193231(A246203(A193231(n))).
Other identities:
For all n > 1, A010060(a(n)) = A091225(n). [Maps binary representations of irreducible GF(2) polynomials (A014580) to odious numbers and the corresponding representations of reducible polynomials (A091242) to evil numbers, in some order].

A246164 Permutation of natural numbers: a(1) = 1, a(A065621(n)) = A014580(a(n-1)), a(A048724(n)) = A091242(a(n)), where A065621(n) and A048724(n) are the reversing binary representation of n and -n, respectively, and A014580 resp. A091242 are the binary coded irreducible resp. reducible polynomials over GF(2).

Original entry on oeis.org

1, 2, 4, 11, 8, 5, 3, 7, 6, 9, 13, 17, 47, 31, 14, 61, 21, 42, 185, 24, 87, 319, 62, 12, 25, 19, 10, 59, 20, 15, 37, 229, 49, 22, 67, 76, 415, 103, 28, 18, 55, 137, 34, 41, 16, 27, 97, 78, 425, 109, 29, 1627, 222, 54, 283, 433, 79, 373, 3053, 33, 131, 647, 108, 847, 133, 745, 6943, 44, 193, 1053, 160, 504, 4333, 587, 99
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where the two complementary pairs to be entangled with each other are A065621/A048724 and A014580/A091242 (binary codes for irreducible and reducible polynomials over GF(2)).
The former are themselves permutations of A000069/A001969 (odious and evil numbers), which means that this permutation shares many properties with A246162.
For the comments about the cycle structure, please see A246163.

Crossrefs

Formula

a(1) = 1, and for n > 1, if A010060(n) = 1 [i.e. when n is an odious number], a(n) = A014580(a(A065620(n)-1)), otherwise a(n) = A091242(a(- (A065620(n)))). [A065620 Converts sum of powers of 2 in binary representation of n to an alternating sum].
As a composition of related permutations:
a(n) = A246202(A193231(n)).
a(n) = A245702(A234025(n)).
a(n) = A246162(A234612(n)).
a(n) = A193231(A246204(A193231(n))).
For all n > 1, A091225(a(n)) = A010060(n). [Maps odious numbers to binary representations of irreducible GF(2) polynomials (A014580) and evil numbers to the corresponding representations of reducible polynomials (A091242), in some order. A246162 has the same property].

A246159 Inverse function to the injection A048724.

Original entry on oeis.org

0, 0, 0, 1, 0, 3, 2, 0, 0, 7, 6, 0, 4, 0, 0, 5, 0, 15, 14, 0, 12, 0, 0, 13, 8, 0, 0, 9, 0, 11, 10, 0, 0, 31, 30, 0, 28, 0, 0, 29, 24, 0, 0, 25, 0, 27, 26, 0, 16, 0, 0, 17, 0, 19, 18, 0, 0, 23, 22, 0, 20, 0, 0, 21, 0, 63, 62, 0, 60, 0, 0, 61, 56, 0, 0, 57, 0, 59, 58, 0, 48, 0, 0, 49, 0, 51, 50, 0, 0, 55, 54, 0, 52, 0, 0, 53, 32
Offset: 0

Views

Author

Antti Karttunen, Aug 18 2014

Keywords

Comments

After a(0)=0, sequence has nonzero values a(n) = k at those positions n for which A048724(k) = n and zeros at those positions n which are not present in A048724.
Equally, sequence is obtained when the positive terms of A065620 are replaced with zeros and the sign of the negative terms is reversed.

Crossrefs

Programs

  • PARI
    a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
    a(n) = -!(hammingweight(n)%2)*a065620(n);
    for(n=0, 100, print1(a(n),", ")) \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1
    def a(n): return -(bin(n)[2:].count("1")%2==0)*a065620(n)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(n) = (1/2) * A010059(n) * A006068(n).
a(n) = -1 * A010059(n) * A065620(n).
a(n) = A246160(n) - A065620(n).
a(n) = A010059(n) * A006068(A245710(n)).
For all n, a(A048724(n)) = n.

A048726 a(n) = Xmult(n,6), or 2*A048724(n).

Original entry on oeis.org

0, 6, 12, 10, 24, 30, 20, 18, 48, 54, 60, 58, 40, 46, 36, 34, 96, 102, 108, 106, 120, 126, 116, 114, 80, 86, 92, 90, 72, 78, 68, 66, 192, 198, 204, 202, 216, 222, 212, 210, 240, 246, 252, 250, 232, 238, 228, 226, 160, 166, 172, 170, 184, 190, 180, 178, 144, 150
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Crossrefs

Programs

A332451 a(n) = A005940(1+A048724(A156552(n))).

Original entry on oeis.org

1, 4, 9, 6, 25, 16, 49, 10, 15, 36, 121, 54, 169, 100, 81, 14, 289, 24, 361, 150, 225, 196, 529, 250, 35, 484, 21, 294, 841, 64, 961, 22, 441, 676, 625, 90, 1369, 1156, 1089, 490, 1681, 144, 1849, 726, 375, 1444, 2209, 686, 77, 60, 1521, 1014, 2809, 40, 1225, 1210, 2601, 2116, 3481, 486, 3721, 3364, 735, 26, 3025, 400
Offset: 1

Views

Author

Antti Karttunen, Feb 15 2020

Keywords

Crossrefs

Cf. A000290, A003961, A005117 (gives the positions of squares), A005940, A008836, A010052, A048724, A156552, A277010, A293448, A332449, A332450.
Permutation of A028260.
Cf. A332460 for complementary sequence (after its initial 1).

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A048724(n) = bitxor(n, 2*n); \\ From A048724
    A156552(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552
    A332451(n) = A005940(1+A048724(A156552(n)));

Formula

a(n) = A005940(1+A048724(A156552(n))).
a(p) = p^2 for all primes p.
For all squarefree numbers u, a(u) = A332449(u) and A010052(a(u)) = 1.
a(A003961(n)) = A003961(a(n)).
a(A293448(n)) = A293448(a(n)).
a(A332450(n)) = A332450(A003961(n)); A332450(a(n)) = A003961(A332450(n)).
A008836(a(n)) = +1 for all n.

A245812 Self-inverse permutation of natural numbers: a(0) = 0, a(1) = 1, and for n > 1, if A065620(n) < 0, a(n) = A065621(1+a(-(A065620(n)))), otherwise a(n) = A048724(a(A065620(n)-1)).

Original entry on oeis.org

0, 1, 3, 2, 6, 7, 4, 5, 15, 14, 13, 12, 11, 10, 9, 8, 24, 25, 26, 27, 28, 29, 30, 31, 16, 17, 18, 19, 20, 21, 22, 23, 57, 56, 59, 58, 61, 60, 63, 62, 49, 48, 51, 50, 53, 52, 55, 54, 41, 40, 43, 42, 45, 44, 47, 46, 33, 32, 35, 34, 37, 36, 39, 38, 106, 107, 104, 105, 110, 111, 108, 109, 98, 99, 96, 97, 102, 103, 100
Offset: 0

Views

Author

Antti Karttunen, Aug 20 2014

Keywords

Comments

This is an instance of entanglement permutation, where complementary pair A048724/A065621 is entangled with the same pair in the opposite order: A065621/A048724, with a(1) set to 1.
Note how this is A193231-conjugate of A054429.

Crossrefs

Programs

  • PARI
    a048724(n) = bitxor(n, 2*n);
    a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
    a065621(n) = bitxor(n, 2*(n - bitand(n, -n)));
    a(n) = x=a065620(n); if(n<2, n, if(x<0, a065621(1 + a(-x)), a048724(a(x - 1))));
    for(n=0, 100, print1(a(n),", ")) \\ Indranil Ghosh, Jun 07 2017
    
  • Python
    def a048724(n): return n^(2*n)
    def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1
    def a065621(n): return n^(2*(n - (n & -n)))
    def a(n):
        x=a065620(n)
        return n if n<2 else a065621(1 + a(-x)) if x<0 else a048724(a(x - 1))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017

Formula

a(0) = 0, a(1) = 1, and for n > 1, if A065620(n) < 0, a(n) = A065621(1+a(-(A065620(n)))), otherwise a(n) = A048724(a(A065620(n)-1)).
Equally:
a(0) = 0, a(1) = 1, and for n > 1, if A010060(n) = 0, a(n) = A065621(1+a(A246159(n))), otherwise a(n) = A048724(a(A246160(n)-1)). [Note how A246159 is an inverse function for A048724, while A246160 is an inverse function for A065621].
As a composition of related permutations:
a(n) = A193231(A234025(n)).
a(n) = A234026(A193231(n)).
a(n) = A193231(A054429(A193231(n))).
Showing 1-10 of 61 results. Next