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.

A243442 Primes p such that, in base 2, p - digitsum(p) is also a prime.

Original entry on oeis.org

5, 23, 71, 83, 101, 113, 197, 281, 317, 353, 359, 373, 401, 467, 599, 619, 683, 739, 751, 773, 977, 1091, 1097, 1103, 1217, 1223, 1229, 1237, 1283, 1303, 1307, 1429, 1433, 1489, 1553, 1559, 1601, 1607, 1613, 1619, 1699, 1873, 1879, 2039, 2347, 2357, 2389
Offset: 1

Views

Author

Anthony Sand, Jun 05 2014

Keywords

Comments

In all bases b, x = n - digitsum(n) is always divisible by b-1, therefore x can be prime only in base 2 and bases b for which b-1 is prime. For example, in base 10, n - digitsum(n) is always divisible by 10 - 1 = 9 -- see A066568 and A068395. In base 8, 9 = 11, therefore 11 - digitsum(11) = 9 - 2 = 7 is divisible by 7.

Examples

			5 - digitsum(5,base=2) = 5 - digitsum(101) = 5 - 2 = 3.
23 - digitsum(10111) = 23 - 4 = 19.
71 - digitsum(1000111) = 71 - 4 = 67.
83 - digitsum(1010011) = 83 - 4 = 79.
101 - digitsum(1100101) = 101 - 4 = 97.
		

Crossrefs

Cf. A243441.

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[#-Total[IntegerDigits[#,2]]]&] (* Harvey P. Dale, May 15 2019 *)
  • PARI
    isok(n) = isprime(n) && isprime(n - hammingweight(n)); \\ Michel Marcus, Jun 05 2014