

A292849


a(n) is the least positive k such that the Hamming weight of k equals the Hamming weight of k*n.


3



1, 1, 3, 1, 7, 3, 7, 1, 15, 7, 3, 3, 5, 7, 15, 1, 31, 15, 7, 7, 13, 3, 7, 3, 31, 5, 31, 7, 31, 15, 31, 1, 63, 31, 11, 15, 7, 7, 7, 7, 57, 13, 3, 3, 23, 7, 11, 3, 21, 31, 43, 5, 39, 31, 7, 7, 9, 31, 35, 15, 21, 31, 63, 1, 127, 63, 23, 31, 15, 11, 15, 15, 29, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

The Hamming weight of a number n is given by A000120(n).
All terms are odd.
Numbers n such that a(n) is not squarefree are 33, 57, 63, 66, 83, 114, 115, 126, 132, 153, 155, ...
Numbers n such that a(n) > n are 5, 9, 17, 25, 27, 29, 33, 41, 65, 97, 101, 109, 113, ...
a(n) = 1 iff n = 2^i for some i >= 0.
a(n) = 3 iff n = A007583(i) * 2^j for some i > 0 and j >= 0.
Apparently:
 if n < 2^k then a(n) < 2^k,
 a(n) = n iff n = A000225(i) for some i > 0.
See also A180012 for the base 10 equivalent sequence.


LINKS

Rémy Sigrist, Table of n, a(n) for n = 1..10000
Altug Alkan, Line graph of n  a(n) for n <= 2^20 + 1
Rémy Sigrist, Scatterplot of n XOR a(n) for n <= 2^16


FORMULA

a((2^m)*n) = a(n) for all m >= 0 and n >= 1.
a(2^m + 1) = 2^(m + 1)  1 for all m >= 0.
a(2^m  1) = 2^m  1 for all m >= 1.
a(2^m) = 1 for all m >= 0.


MATHEMATICA

Table[SelectFirst[Range[1, 2^8 + 1, 2], Equal @@ Thread[DigitCount[{#, # n}, 2, 1]] &], {n, 74}] (* Michael De Vlieger, Sep 25 2017 *)


PROG

(PARI) a(n) = forstep(k=1, oo, 2, if (hammingweight(k) == hammingweight(k*n), return (k)))
(PARI) a(n)=my(k=1); while ((hammingweight(k)) != hammingweight(k*n), k++); k;


CROSSREFS

Cf. A000120, A000225, A007583, A115873, A180012.
Sequence in context: A247675 A053092 A212045 * A115873 A329369 A083239
Adjacent sequences: A292846 A292847 A292848 * A292850 A292851 A292852


KEYWORD

nonn,base,easy,look


AUTHOR

Rémy Sigrist and Altug Alkan, Sep 25 2017


STATUS

approved



