%I #15 Oct 17 2022 08:37:30
%S 0,1,1,3,1,3,3,7,1,3,3,11,3,11,7,15,1,3,3,19,3,7,11,23,3,19,11,27,7,
%T 23,15,31,1,3,3,35,3,37,19,39,3,37,7,43,11,45,23,47,3,35,19,51,11,43,
%U 27,55,7,39,23,55,15,47,31,63,1,3,3,67,3,11,35,71,3,7
%N a(n) is the least k such that the sets of positions of 1's in the binary expansions of n and k are similar.
%C Let s(n) be the set of terms in the n-th row of A133457 (with s(0) = {}).
%C a(n) is the least k such that s(n) is the image of s(k) under some nonconstant linear function.
%H Rémy Sigrist, <a href="/A356354/b356354.txt">Table of n, a(n) for n = 0..8192</a>
%H Rémy Sigrist, <a href="/A356354/a356354.gp.txt">PARI program</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Similarity_(geometry)">Similarity (geometry)</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A000120(a(n)) = A000120(n).
%F a(a(n)) = a(n).
%F a(2*n) = a(n).
%F a(A030101(n)) = a(n).
%F a(n) = 1 iff n is a power of 2.
%F a(n) = 3 iff n belongs to A018900.
%F a(2^k - 1) = 2^k - 1 for any k >= 0.
%e The first terms, alongside their binary expansions, are:
%e n a(n) bin(n) bin(a(n))
%e -- ---- ------ ---------
%e 0 0 0 0
%e 1 1 1 1
%e 2 1 10 1
%e 3 3 11 11
%e 4 1 100 1
%e 5 3 101 11
%e 6 3 110 11
%e 7 7 111 111
%e 8 1 1000 1
%e 9 3 1001 11
%e 10 3 1010 11
%e 11 11 1011 1011
%e 12 3 1100 11
%e 13 11 1101 1011
%e 14 7 1110 111
%e 15 15 1111 1111
%e 16 1 10000 1
%o (PARI) See Links section.
%Y Cf. A000120, A000265, A018900, A030101, A064895, A133457.
%K nonn,base
%O 0,4
%A _Rémy Sigrist_, Oct 15 2022