[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A074202
Numbers k such that the number of 1's in the binary expansion of k divides 2^k-1.
3
1, 2, 4, 8, 14, 16, 22, 26, 28, 32, 38, 42, 44, 50, 52, 56, 64, 70, 74, 76, 82, 84, 88, 98, 100, 104, 112, 124, 128, 134, 138, 140, 146, 148, 152, 162, 164, 168, 176, 188, 194, 196, 200, 208, 220, 224, 236, 244, 248, 256, 262, 266, 268, 274, 276, 280, 290, 292
OFFSET
1,2
COMMENTS
Odd terms (1, 351, 375, ...) are in A074203.
LINKS
MATHEMATICA
Select[Range[300], (d = DigitCount[#, 2, 1]) == 1 || PowerMod[2, #, d] == 1 &] (* Amiram Eldar, Jul 30 2020 *)
PROG
(PARI) isok(n) = !((2^n-1) % hammingweight(n)); \\ Michel Marcus, Nov 29 2013
(Python)
from itertools import count, islice
def A074202_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:not ((1<<n)-1) % n.bit_count(), count(max(startvalue, 1)))
A074202_list = list(islice(A074202_gen(), 20)) # Chai Wah Wu, Mar 09 2023
CROSSREFS
Different from A128309.
Sequence in context: A049133 A063033 A128309 * A086303 A209838 A121982
KEYWORD
base,easy,nonn
AUTHOR
Benoit Cloitre, Sep 17 2002
EXTENSIONS
Edited by N. J. A. Sloane, May 10 2007
STATUS
approved