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.

Previous Showing 21-30 of 213 results. Next

A285117 Triangle read by rows: T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) XOR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and XOR is bitwise-XOR (A003987).

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 3, 3, 1, 1, 2, 0, 2, 1, 1, 5, 2, 2, 5, 1, 1, 4, 15, 0, 15, 4, 1, 1, 7, 9, 27, 27, 9, 7, 1, 1, 6, 18, 54, 0, 54, 18, 6, 1, 1, 9, 20, 36, 126, 126, 36, 20, 9, 1, 1, 8, 45, 112, 42, 0, 42, 112, 45, 8, 1, 1, 11, 39, 85, 170, 46, 46, 170, 85, 39, 11, 1, 1, 10, 60, 146, 495, 132, 0, 132, 495, 146, 60, 10, 1
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Examples

			Rows 0 - 12 of the triangle:
  1,
  1, 1,
  1, 0, 1,
  1, 3, 3, 1,
  1, 2, 0, 2, 1,
  1, 5, 2, 2, 5, 1,
  1, 4, 15, 0, 15, 4, 1,
  1, 7, 9, 27, 27, 9, 7, 1,
  1, 6, 18, 54, 0, 54, 18, 6, 1,
  1, 9, 20, 36, 126, 126, 36, 20, 9, 1,
  1, 8, 45, 112, 42, 0, 42, 112, 45, 8, 1,
  1, 11, 39, 85, 170, 46, 46, 170, 85, 39, 11, 1,
  1, 10, 60, 146, 495, 132, 0, 132, 495, 146, 60, 10, 1
		

Crossrefs

Cf. A285114 (row sums).

Programs

  • Mathematica
    T[n_, k_]:= If[n==0 || n==k, 1, BitXor[Binomial[n - 1, k - 1], Binomial[n - 1, k]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    T(n, k) = if (n==0 || n==k, 1, bitxor(binomial(n - 1, k - 1), binomial(n - 1, k)));
    for(n=0, 12, for(k=0, n, print1(T(n, k),", ");); print();) \\ Indranil Ghosh, Apr 16 2017
  • Scheme
    (define (A285117 n) (A285117tr (A003056 n) (A002262 n)))
    (define (A285117tr n k) (cond ((zero? k) 1) ((= k n) 1) (else (A003987tr (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A003987bi implements bitwise-XOR (A003987) and A007318tr gives the binomial coefficients (A007318).
    

Formula

T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) XOR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and XOR is bitwise-XOR (A003987).
T(n,k) = A285116(n,k) - A285118(n,k).
C(n,k) = T(n,k) + 2*A285118(n,k). [Where C(n,k) = A007318.]

A286155 Square array A(n,k) read by antidiagonals, A(n,n) = -n, otherwise, if n > k, A(n,k) = T(n XOR k,k), else A(n,k) = T(n,n XOR k), where T(n,k) is sequence A000027 considered as a two-dimensional table and XOR is bitwise-xor (A003987).

Original entry on oeis.org

-1, 4, 6, 2, -2, 3, 11, 3, 2, 15, 7, 23, -3, 27, 10, 22, 30, 39, 43, 35, 28, 16, 12, 31, -4, 34, 14, 21, 37, 17, 24, 10, 7, 26, 20, 45, 29, 57, 18, 14, -5, 12, 19, 65, 36, 56, 68, 81, 19, 26, 24, 18, 89, 77, 66, 46, 38, 69, 109, 20, -6, 17, 117, 76, 44, 55, 79, 47, 58, 124, 141, 21, 16, 149, 133, 64, 54, 91, 67, 107, 48, 140, 125, 177, -7, 185, 132, 150, 53, 119
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Examples

			The top left 1 .. 12 x 1 .. 12 corner of the array:
  -1,   4,   2,  11,   7,  22,  16,  37,  29,  56,  46,  79
   6,  -2,   3,  23,  30,  12,  17,  57,  68,  38,  47, 107
   3,   2,  -3,  39,  31,  24,  18,  81,  69,  58,  48, 139
  15,  27,  43,  -4,  10,  14,  19, 109, 124, 140, 157,  59
  10,  35,  34,   7,  -5,  26,  20, 141, 125, 176, 158,  83
  28,  14,  26,  12,  24,  -6,  21, 177, 196, 142, 159, 111
  21,  20,  19,  18,  17,  16,  -7, 217, 197, 178, 160, 143
  45,  65,  89, 117, 149, 185, 225,  -8,  36,  44,  53,  63
  36,  77,  76, 133, 132, 205, 204,  29,  -9,  64,  54,  87
  66,  44,  64, 150, 186, 148, 184,  38,  58, -10,  55, 115
  55,  54,  53, 168, 167, 166, 165,  48,  47,  46, -11, 147
  91, 119, 151,  63,  87, 115, 147,  59,  83, 111, 143, -12
		

Crossrefs

Cf. also arrays A285732, A286151, A286153.

Programs

Formula

If n = k, A(n,k) = -n, if n > k, A(n,k) = T(A003987(n,k),k), otherwise [when n < k], A(n,k) = T(n,A003987(n,k)), where T(n,k) is sequence A000027 considered as a two-dimensional table, that is, as a pairing function from N x N to N.

A378988 a(n) = 2*n XOR 1+sigma(n), where XOR is bitwise-xor, A003987.

Original entry on oeis.org

0, 0, 3, 0, 13, 1, 7, 0, 28, 7, 27, 5, 21, 5, 7, 0, 49, 12, 51, 3, 11, 9, 55, 13, 18, 31, 31, 1, 37, 117, 31, 0, 115, 115, 119, 20, 109, 113, 119, 11, 121, 53, 123, 13, 21, 21, 111, 29, 88, 58, 47, 11, 93, 21, 39, 9, 35, 47, 75, 209, 69, 29, 23, 0, 215, 21, 195, 247, 235, 29, 199, 84, 217, 231, 235, 21, 251, 53, 207
Offset: 1

Views

Author

Antti Karttunen, Dec 16 2024

Keywords

Comments

For any hypothetical quasiperfect number q (for which sigma(q) = 2*q+1, see A336701), a(q) would be equal to 2*q XOR 2*q+2 = 2*(q XOR q+1) = 2*A038712(1+q) = A100892(1+q).
See also A000079 and A235796 concerning the "almost perfect" or "least deficient" numbers that give positions of 0's here.

Crossrefs

Cf. A000079 (conjectured to give positions of all 0's), A000396 (positions of 1's), A000203, A003987, A028982 (positions of even terms), A028983 (of odd terms), A038712, A100892, A318467, A336701, A378998, A379009 [= a(n^2)].

Programs

  • Mathematica
    Array[BitXor[2*#, DivisorSigma[1, #] + 1] &, 100] (* Paolo Xausa, Dec 16 2024 *)
  • PARI
    A378988(n) = bitxor(n+n,1+sigma(n));

Formula

For all n in A028983, a(n) = 2n+1 XOR sigma(n) = 1+A318467(n).

A283999 a(n) = A005187(n) XOR A006068(n), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 0, 0, 6, 0, 14, 14, 14, 0, 30, 30, 30, 30, 30, 18, 16, 0, 62, 62, 62, 62, 62, 50, 48, 62, 62, 34, 32, 34, 32, 44, 44, 0, 126, 126, 126, 126, 126, 114, 112, 126, 126, 98, 96, 98, 96, 108, 108, 126, 126, 66, 64, 66, 64, 76, 76, 66, 64, 92, 92, 92, 92, 92, 82, 0, 254, 254, 254, 254, 254, 242, 240, 254, 254, 226, 224, 226, 224, 236, 236, 254, 254, 194, 192, 194
Offset: 0

Views

Author

Antti Karttunen, Mar 20 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[BitXor[Fold[BitXor, n, Quotient[n, 2^Range[BitLength@ n - 1]]], 2 n - DigitCount[2 n, 2, 1]], {n, 0, 84}] (* Michael De Vlieger, Mar 20 2017, after Jan Mangaldan at A006068 *)
  • PARI
    b(n) = if(n<1, 0, b(n\2) + n%2);
    A(n) = 2*n - b(2*n);
    a(n) = if(n<2, n, 2*a(floor(n/2)) + (n%2 + a(floor(n/2))%2)%2);
    for(n=0, 110, print1(bitxor(A(n),a(n)),", ")) \\ Indranil Ghosh, Mar 25 2017
    
  • Python
    def A(n): return 2*n - bin(2*n)[2:].count("1")
    def a(n): return n if n<2 else 2*a(n//2) + (n%2 + a(n//2)%2)%2
    print([A(n)^a(n) for n in range(111)]) # Indranil Ghosh, Mar 25 2017
  • Scheme
    (define (A283999 n) (A003987bi (A005187 n) (A006068 n))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(n) = A005187(n) XOR A006068(n), where XOR is bitwise-xor (A003987).
a(n) = A006068(2*n) XOR A283997(2*n).

A318460 a(n) = Sum_{d|n, d < n/d} (d XOR n/d), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 3, 2, 5, 4, 8, 6, 15, 8, 18, 10, 24, 12, 20, 20, 27, 16, 35, 18, 30, 24, 32, 22, 52, 24, 42, 36, 44, 28, 56, 30, 63, 40, 54, 36, 81, 36, 56, 52, 90, 40, 80, 42, 80, 68, 68, 46, 116, 48, 93, 68, 86, 52, 112, 68, 112, 72, 90, 58, 144, 60, 92, 98, 119, 72, 136, 66, 122, 88, 128, 70, 171, 72, 114, 110, 136, 88, 152, 78
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

  • PARI
    A318460(n) = { my(xors=0); fordiv(n,d, if(d<(n/d), xors += bitxor(d,n/d))); (xors); };

Formula

a(n) = (1/2) * Sum_{d|n} (d XOR n/d).
a(n) = A318462(n) - A037213(n).

A325317 a(n) = A048250(n) XOR A162296(n), where XOR is the bitwise-XOR, A003987.

Original entry on oeis.org

1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24, 31, 18, 23, 20, 10, 32, 36, 24, 60, 31, 42, 32, 56, 30, 72, 32, 63, 48, 54, 48, 67, 38, 60, 56, 90, 42, 96, 44, 20, 46, 72, 48, 124, 57, 89, 72, 18, 54, 96, 72, 120, 80, 90, 60, 40, 62, 96, 104, 127, 84, 144, 68, 126, 96, 144, 72, 187, 74, 114, 124, 108, 96, 168, 80
Offset: 1

Views

Author

Antti Karttunen, Apr 21 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Array[BitXor @@ Map[Total, {#3, Complement[#2, #3]}] & @@ {#1, #2, Select[#2, SquareFreeQ]} & @@ {#, Divisors[#]} &, 79] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    A048250(n) = factorback(apply(p -> p+1,factor(n)[,1]));
    A162296(n) = sumdiv(n, d, d*(1-issquarefree(d)));
    A325317(n) = bitxor(A048250(n),A162296(n));

Formula

a(n) = A003987(A048250(n), A162296(n)).
a(n) = A000203(n) - 2*A325318(n) = A325316(n) - A325318(n).

A355340 a(0) = 0; for n >= 1, a(n) = a(n-1) XOR A001511(n), where XOR denotes bitwise exclusive-or (A003987) and A001511 is the binary ruler function.

Original entry on oeis.org

0, 1, 3, 2, 1, 0, 2, 3, 7, 6, 4, 5, 6, 7, 5, 4, 1, 0, 2, 3, 0, 1, 3, 2, 6, 7, 5, 4, 7, 6, 4, 5, 3, 2, 0, 1, 2, 3, 1, 0, 4, 5, 7, 6, 5, 4, 6, 7, 2, 3, 1, 0, 3, 2, 0, 1, 5, 4, 6, 7, 4, 5, 7, 6, 1, 0, 2, 3, 0, 1, 3, 2, 6, 7, 5, 4, 7, 6, 4, 5, 0, 1, 3, 2, 1, 0, 2, 3, 7, 6, 4, 5, 6, 7, 5, 4, 2, 3, 1, 0, 3, 2, 0, 1, 5
Offset: 0

Views

Author

Peter Munn, Jun 29 2022

Keywords

Comments

Related to the Thue-Morse sequence, A010060, which gives the rightmost binary bit of each term. The next bit is given by the closely related A269723.
If we replace A001511(n) in the definition by A006519(n) = 2^(A001511(n)-1) we get Gray code (A003188).
Interesting symmetries of the sequence seem more apparent with the terms aligned in suitable periods, such as the arrangement in the example section.

Examples

			Initial terms arranged in periods of 16, with deliberate periodic spacing:
  0,1,3,2,  1,0,2,3,     7,6,4,5,  6,7,5,4,
  1,0,2,3,  0,1,3,2,     6,7,5,4,  7,6,4,5,
  3,2,0,1,  2,3,1,0,     4,5,7,6,  5,4,6,7,
  2,3,1,0,  3,2,0,1,     5,4,6,7,  4,5,7,6,
.
  1,0,2,3,  0,1,3,2,     6,7,5,4,  7,6,4,5,
  0,1,3,2,  1,0,2,3,     7,6,4,5,  6,7,5,4,
  2,3,1,0,  3,2,0,1,     5,4,6,7,  4,5,7,6,
  3,2,0,1,  2,3,1,0,     4,5,7,6,  5,4,6,7,
...
Note that when the arrangement is partitioned regularly into 2 X 2, 4 X 4 or 8 X 8 squares, the terms on any diagonal of a square share the same value. Note also the symmetry of the terms on the squares' circumferences.
		

Crossrefs

Comparable sequences: A010060, A261283, A269723.
Positions of: odd numbers: A000069, even numbers: A001969, previously unseen numbers: A253317 (apparently).

Programs

  • Mathematica
    Block[{k = 0}, NestList[BitXor[#, IntegerExponent[k += 2, 2]] &, 0, 100]] (* Paolo Xausa, May 29 2024 *)

Formula

A010060(n) = a(n) mod 2.
A269723(n) = floor(a(n)/2) mod 2.

A283979 a(n) = (n XOR A264977(n))/4, where XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 2, 3, 0, 3, 0, 0, 0, 7, 6, 5, 4, 4, 6, 7, 0, 5, 6, 5, 0, 7, 0, 0, 0, 15, 14, 9, 12, 10, 10, 9, 8, 10, 8, 8, 12, 10, 14, 15, 0, 9, 10, 15, 12, 14, 10, 9, 0, 9, 14, 9, 0, 15, 0, 0, 0, 31, 30, 17, 28, 22, 18, 21, 24, 20, 20, 18, 20, 16, 18, 17, 16, 22, 20, 22, 16, 21, 16, 16, 24, 16, 20, 18, 28, 22, 30, 31, 0, 17, 18, 27, 20, 28, 30
Offset: 0

Views

Author

Antti Karttunen, Mar 25 2017

Keywords

Crossrefs

Programs

Formula

a(n) = (n XOR A264977(n))/4, where XOR is bitwise-xor (A003987).

A329331 Binary operation over the nonnegative integers, distributive over A003987(.,.), such that A(2^i, 2^j) = 2^A054237(i,j). Square array A(n,k), n >= 0, k >= 0, read by descending antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 8, 3, 0, 0, 4, 10, 10, 4, 0, 0, 5, 16, 9, 16, 5, 0, 0, 6, 18, 20, 20, 18, 6, 0, 0, 7, 24, 23, 32, 23, 24, 7, 0, 0, 8, 26, 30, 36, 36, 30, 26, 8, 0, 0, 9, 64, 29, 48, 33, 48, 29, 64, 9, 0, 0, 10, 66, 72, 52, 54, 54, 52, 72, 66, 10, 0, 0, 11, 72, 75, 128, 51, 40, 51, 128, 75, 72, 11, 0
Offset: 0

Views

Author

Peter Munn, Nov 10 2019

Keywords

Comments

This sequence defines a multiplication operation that goes with bitwise exclusive-or (A003987) as addition operation to form a ring over the nonnegative integers. It is isomorphic to the polynomial ring GF(2)[x,y], as is the ring defined in A329329.
The ring defined by A329329 is unusual in that it has A059897(.,.) as its addition operation, given that A059897 has more similarities to integer multiplication. A003987, which is isomorphic to A059897 as a binary operation, seems a more standard choice for an addition operator.
However, as explained in A329329, A059897 has a natural choice for mapping a generating set to the 2-dimensions (x and y) of the generating set for the additive group of GF(2)[x,y]. Instead, A003987 needs a pairing function to map its most natural generating set {2^k: k >= 0} onto {x^i * y^j: i >= 0, j >= 0}.
The choice made here was to map 2^k onto the 2 dimensions of x^i * y^j, by proceeding through x and y dimensions as when reading an array by antidiagonals. 2^0 = 1 is mapped to (x^0 * y*0) = 1, 2^1 = 2 is mapped to (x^1 * y^0) = x, 2^2 = 4 to (x^0 * y^1) = y, 8 to (x^2 * y^0) = x^2, and so on, 16 mapped to xy, 32 to y^2, 64 to x^3, etc. With this mapping, it can be shown that the result of the multiplying the polynomial images of 2^i and 2^j is the image of 2^A054237(i,j).

Examples

			Square array A(n,k) begins:
  n\k |   0     1     2     3     4     5     6     7     8     9    10
  ----+----------------------------------------------------------------
    0 |   0     0     0     0     0     0     0     0     0     0     0
    1 |   0     1     2     3     4     5     6     7     8     9    10
    2 |   0     2     8    10    16    18    24    26    64    66    72
    3 |   0     3    10     9    20    23    30    29    72    75    66
    4 |   0     4    16    20    32    36    48    52   128   132   144
    5 |   0     5    18    23    36    33    54    51   136   141   154
    6 |   0     6    24    30    48    54    40    46   192   198   216
    7 |   0     7    26    29    52    51    46    41   200   207   210
    8 |   0     8    64    72   128   136   192   200  1024  1032  1088
    9 |   0     9    66    75   132   141   198   207  1032  1025  1098
   10 |   0    10    72    66   144   154   216   210  1088  1098  1032
		

Crossrefs

Formula

A(2^i, 2^j) = 2^A054237(i,j).
A(A003987(n,m), k) = A003987(A(n,k), A(m,k)).
A(n, A003987(m,k)) = A003987(A(n,m), A(n,k)).
Derived formulas:(Start)
A(n,k) = A(k,n).
A(n,0) = A(0,k) = 0.
A(n,1) = A(1,n) = n.
A(n, A(m,k)) = A(A(n,m), k).
(End)

A375551 a(n) = Sum_{k=0..n} k XOR n-k, where XOR is the bitwise exclusive disjunction. Row sums of A003987.

Original entry on oeis.org

0, 2, 4, 12, 12, 22, 32, 56, 48, 58, 68, 100, 108, 142, 176, 240, 208, 210, 212, 252, 252, 294, 336, 424, 416, 458, 500, 596, 636, 734, 832, 992, 896, 866, 836, 876, 844, 886, 928, 1048, 1008, 1050, 1092, 1220, 1260, 1390, 1520, 1744, 1680, 1714, 1748, 1884, 1916
Offset: 0

Views

Author

Peter Luschny, Sep 27 2024

Keywords

Crossrefs

Programs

  • Maple
    XOR := (n, k) -> Bits:-Xor(n, k):
    a := n -> local k; add(XOR(k, n-k), k=0..n):
    seq(a(n), n = 0..52);
  • Mathematica
    (* Using definition *)
    Table[Sum[BitXor[n - k, k], {k, 0, n}], {n, 0, 100}]
    (* Using recurrence -- faster *)
    a[0] = 0; a[n_] := a[n] = If[OddQ[n], 4*a[(n-1)/2] + n + 1, 2*(a[n/2] + a[n/2-1])];
    Table[a[n], {n, 0, 100}] (* Paolo Xausa, Oct 01 2024 *)
  • PARI
    a(n) = sum(k=0, n, bitxor(k, n-k)); \\ Michel Marcus, Sep 28 2024

Formula

a(n) = 2*A099027(n).
a(n) = 2*n + A006582(n).
a(2^n - 1) = 4^n - 2^n = A020522(n).
a(2^n) = 4^n - 2^n*(n - 1) = 2*A376585(n).
Recurrence: a(0) = 0; a(2*n) = 2*(a(n) + a(n-1)); a(2*n+1) = 2*(2*a(n) + n + 1). - Paolo Xausa, Oct 01 2024, derived from recurrence in A099027.
Previous Showing 21-30 of 213 results. Next