OFFSET
1,1
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.
LINKS
Anthony Sand, Table of n, a(n) for n = 1..1000
EXAMPLE
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.
MATHEMATICA
Select[Prime[Range[400]], PrimeQ[#-Total[IntegerDigits[#, 2]]]&] (* Harvey P. Dale, May 15 2019 *)
PROG
(PARI) isok(n) = isprime(n) && isprime(n - hammingweight(n)); \\ Michel Marcus, Jun 05 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Anthony Sand, Jun 05 2014
STATUS
approved