OFFSET
1,2
COMMENTS
This sequence has density 6/Pi^2 (Olivier, 1975).
All primes, powers of 2, and powers of two plus one are terms of this sequence. - William Boyles, Jan 27 2022
REFERENCES
Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge University Press, 2003, p. 117.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Christian Mauduit, Carl Pomerance and András Sárközy, On the distribution in residue classes of integers with a fixed sum of digits, The Ramanujan Journal, Vol. 9, No. 1-2 (2005), pp. 45-62; alternative link.
Michel Olivier, Sur la probabilité que n soit premier à la somme de ses chiffres, C. R. Math. Acad. Sci. Paris, Série A, Vol. 280 (1975), pp. 543-545.
Michel Olivier, Fonctions g-additives et formule asymptotique pour la propriété (n, f(n)) = q, Acta Arithmetica, Vol. 31, No. 4 (1976), pp. 361-384; alternative link.
MATHEMATICA
Select[Range[100], CoprimeQ[#, DigitCount[#, 2, 1]] &] (* Amiram Eldar, Nov 22 2020 *)
PROG
(PARI) lista(nn) = {for (n=1, nn, if (gcd(n, norml2(binary(n))) == 1, print1(n, ", ")); ); } \\ Michel Marcus, May 25 2013
(Python)
from math import gcd
def ok(n): return gcd(n, bin(n).count('1')) == 1
print([k for k in range(104) if ok(k)]) # Michael S. Branicky, Jan 25 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Benoit Cloitre, Jun 08 2004
STATUS
approved