%I #11 Sep 17 2022 09:53:46
%S 1,2,3,4,5,5,7,8,9,10,11,9,11,11,15,16,17,17,19,17,19,19,23,17,19,19,
%T 23,19,23,23,31,32,33,34,35,36,37,37,39,34,37,42,43,37,45,43,47,33,35,
%U 37,39,37,43,45,47,35,39,43,47,39,47,47,63,64,65,65,67,65
%N Smallest k that is cyclically equivalent (see Comment for definition) to n.
%C Two positive integers k and n are cyclically equivalent (as defined by Hladnik, Marušič, and Pisanski, 2002) if they have the same number m of binary digits, and there exist integers s and t such that gcd(s,m) = 1 and the map x -> s*x+t mod m maps the set of exponents of 2 occurring in the binary expansion of n bijectively to the corresponding set for k. (In particular, A000120(k) = A000120(n).) For example, k = 17 = 2^0 + 2^4 and n = 18 = 2^1 + 2^4 are cyclically equivalent, because the map x -> 2*x+2 mod 5 maps {1,4} to {0,4}.
%C The fixed points are the terms of A357006.
%C The number of fixed points n in the interval 2^(m-1) <= n < 2^m equals A002729(m)-1.
%H Pontus von Brömssen, <a href="/A357005/b357005.txt">Table of n, a(n) for n = 1..10000</a>
%H Milan Hladnik, Dragan Marušič, and Tomaž Pisanski, <a href="https://doi.org/10.1016/S0012-365X(01)00064-4">Cyclic Haar graphs</a>, Discrete Mathematics 244 (2002), 137-152.
%F a(a(n)) = a(n).
%F a(n) = A357004(n) for n <= 146, but a(147) = 147 > 141 = A357004(147).
%F A357004(n) <= a(n) <= A163382(n).
%o (Python)
%o from math import gcd
%o def A357005(n):
%o p=[int(d) for d in format(n,'b')]
%o m=len(p)
%o p0=min([p[(k*i+j)%m] for i in range(m)] for k in range(1,m+1) if gcd(k,m)==1 for j in range(m) if p[j])
%o return sum(p0[i]*2**(m-1-i) for i in range(m))
%Y Cf. A000120, A002729, A163382, A267508, A357004, A357006.
%K nonn
%O 1,2
%A _Pontus von Brömssen_, Sep 08 2022
|