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 11-12 of 12 results.

A359946 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, n XOR a(n) is a prime number (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 19 2023

Keywords

Comments

This sequence is a self-inverse permutation of the positive integers.
See A359947 for the corresponding prime numbers.
When considering nonnegative integers instead of positive integers, we obtain A004443.

Examples

			The first terms, alongside n XOR a(n), are:
  n   a(n)  n XOR a(n)
  --  ----  ----------
   1     2           3
   2     1           3
   3     4           7
   4     3           7
   5     6           3
   6     5           3
   7    10          13
   8    11           3
   9    12           5
  10     7          13
  11     8           3
  12     9           5
		

Crossrefs

Programs

A352526 a(n) = Product_{k=0..n} Nimsum (2*k + 2), with Nimsum (2 + 2) = 0 replaced by 1.

Original entry on oeis.org

2, 2, 12, 48, 480, 3840, 53760, 645120, 11612160, 185794560, 4087480320, 81749606400, 2125489766400, 51011754393600, 1530352631808000, 42849873690624000, 1456895705481216000, 46620662575398912000, 1771585177865158656000, 63777066403145711616000, 2678636788932119887872000
Offset: 0

Views

Author

Peter McNair, Mar 19 2022

Keywords

Comments

Nimsum 2*k + 2 = A004443(2*k).
Sum_{n>0} 1/a(n) = 1/sqrt(e) = A092605.
Sum_{n>0} 1/a(2*n-1) = sinh(1/2) = A334367.
Sum_{n>0} 1/a(2*n) = cosh(1/2) - 2*sinh(1/2).
a(n)/2^n = abs(A265376(n+1)) = Product_{k=0..n} Nimsum k + 1, with Nimsum 1 + 1 = 0 replaced by 1, n > 0.

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[If[k == 1, 1, BitXor[2*k, 2]], {k, 0, n}]; Array[a, 21, 0] (* Amiram Eldar, Mar 19 2022 *)
  • PARI
    a(n) = 2*prod(k=2,n,bitxor(2*k, 2))

Formula

a(n) = 2*Product_{k=2..n} A004443(2*k).
a(n) = 2^(n-1)*(n+1)!/floor((n+1)/2), n > 0.
a(n) = 2^(n-1)*(1+(-1)^n)*((n-1)!+n!)-((-1)^n-1)*(2*n)!!/2, n > 0.
a(n) = 2*a(n-1)*(n+(-1)^n), n > 1, with a(1) = 2.
Previous Showing 11-12 of 12 results.