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.

This page as a plain text file.
%I A243442 #24 May 15 2019 10:39:41
%S A243442 5,23,71,83,101,113,197,281,317,353,359,373,401,467,599,619,683,739,
%T A243442 751,773,977,1091,1097,1103,1217,1223,1229,1237,1283,1303,1307,1429,
%U A243442 1433,1489,1553,1559,1601,1607,1613,1619,1699,1873,1879,2039,2347,2357,2389
%N A243442 Primes p such that, in base 2, p - digitsum(p) is also a prime.
%C A243442 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.
%H A243442 Anthony Sand, <a href="/A243442/b243442.txt">Table of n, a(n) for n = 1..1000</a>
%e A243442 5 - digitsum(5,base=2) = 5 - digitsum(101) = 5 - 2 = 3.
%e A243442 23 - digitsum(10111) = 23 - 4 = 19.
%e A243442 71 - digitsum(1000111) = 71 - 4 = 67.
%e A243442 83 - digitsum(1010011) = 83 - 4 = 79.
%e A243442 101 - digitsum(1100101) = 101 - 4 = 97.
%t A243442 Select[Prime[Range[400]],PrimeQ[#-Total[IntegerDigits[#,2]]]&] (* _Harvey P. Dale_, May 15 2019 *)
%o A243442 (PARI) isok(n) = isprime(n) && isprime(n - hammingweight(n)); \\ _Michel Marcus_, Jun 05 2014
%Y A243442 Cf. A243441.
%K A243442 nonn,base
%O A243442 1,1
%A A243442 _Anthony Sand_, Jun 05 2014