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-2 of 2 results.

A375485 a(n) is the number of integers k between 0 and n such that n XOR k is a prime number (where XOR denotes the bitwise XOR operator).

Original entry on oeis.org

0, 0, 2, 2, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 6, 6, 5, 5, 7, 7, 7, 7, 9, 9, 7, 7, 9, 9, 9, 9, 11, 11, 7, 7, 9, 9, 9, 9, 11, 11, 9, 9, 11, 11, 11, 11, 13, 13, 12, 12, 14, 14, 14, 14, 16, 16, 14, 14, 16, 16, 16, 16, 18, 18, 13, 13, 15, 15, 15, 15, 17, 17, 15, 15, 17
Offset: 0

Views

Author

Rémy Sigrist, Aug 17 2024

Keywords

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  -------------------
   0     0  None
   1     0  None
   2     2  0, 1
   3     2  0, 1
   4     2  1, 3
   5     2  0, 2
   6     4  1, 3, 4, 5
   7     4  0, 2, 4, 5
   8     2  3, 5
   9     2  2, 4
  10     4  1, 7, 8, 9
  11     4  0, 6, 8, 9
  12     4  1, 7, 9, 11
  13     4  0, 6, 8, 10
  14     6  3, 5, 9, 11, 12, 13
  15     6  2, 4, 8, 10, 12, 13
		

Crossrefs

Cf. A054429, A375486 (OR variant), A375487 (AND variant).

Programs

  • PARI
    a(n) = sum(k = 0, n, isprime(bitxor(n, k)))

Formula

Empirically, if 2^k <= n < 2^(k+1) then a(n) + a(A054429(n)) only depends on k.

A375486 a(n) is the number of integers k between 0 and n such that n OR k is a prime number (where OR denotes the bitwise OR operator).

Original entry on oeis.org

0, 0, 3, 4, 2, 6, 3, 8, 2, 4, 3, 8, 3, 8, 0, 0, 5, 12, 7, 16, 7, 14, 11, 24, 6, 12, 6, 12, 14, 30, 15, 32, 7, 14, 6, 12, 9, 20, 4, 8, 13, 28, 17, 36, 11, 22, 15, 32, 9, 18, 6, 12, 13, 28, 0, 0, 14, 28, 15, 32, 15, 32, 0, 0, 13, 26, 15, 32, 13, 26, 19, 40, 14
Offset: 0

Views

Author

Rémy Sigrist, Aug 17 2024

Keywords

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------------------------
   0     0  None
   1     0  None
   2     3  0, 1, 2
   3     4  0, 1, 2, 3
   4     2  1, 3
   5     6  0, 1, 2, 3, 4, 5
   6     3  1, 3, 5
   7     8  0, 1, 2, 3, 4, 5, 6, 7
   8     2  3, 5
   9     4  2, 3, 4, 5
  10     3  1, 3, 9
  11     8  0, 1, 2, 3, 8, 9, 10, 11
  12     3  1, 5, 9
  13     8  0, 1, 4, 5, 8, 9, 12, 13
  14     0  None
  15     0  None
		

Crossrefs

Cf. A375485 (XOR variant), A375487 (AND variant).

Programs

  • PARI
    a(n) = sum(k = 0, n, isprime(bitor(n, k)))
Showing 1-2 of 2 results.