This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A380728 #14 Feb 03 2025 21:32:30 %S A380728 1,2,5,4,3,17,11,8,10,9,7,65,14,13,23,16,6,257,21,33,19,25,15,1025,22, %T A380728 35,29,37,27,43,47,32,20,129,26,4097,28,41,46,513,38,67,30,49,53,39, %U A380728 31,16385,44,69,58,73,45,71,59,81,77,51,55,83,62,61,95,64,12 %N A380728 For n a power of 2, a(n) = n. Otherwise a(n) is the smallest number not yet in the sequence which is coprime to n and has the same binary weight as n. %C A380728 Self inverse sequence with fixed points on powers of 2 (similar to A005940). Records subsequence (after 1,2) set by odd numbers with binary weight = 2 (see A000051, for n >= 2, and also A048578). %C A380728 Conjectured to be a permutation of the natural numbers (primes not in order). %H A380728 Michael De Vlieger, <a href="/A380728/b380728.txt">Table of n, a(n) for n = 1..16384</a> %H A380728 Michael De Vlieger, <a href="/A380728/a380728.png">Log log scatterplot of log_2(a(n))</a>, n = 2..2^14. %F A380728 a(a(n)) = n for all n. %e A380728 a(1) = 1, the smallest novel number coprime to 1 and having same binary weight (1) %e A380728 a(3) = 5, since weight(3) = weight(5) = 2 and gcd(2,5) = 1, and 5 is least such number. %e A380728 a(5) = 3 (sequence is self inverse). %t A380728 nn = 2^13; c[_] := False; u = 1; %t A380728 f[x_] := f[x] = DigitCount[x, 2, 1]; %t A380728 Reap[Do[w = f[n]; %t A380728 Which[w == 1, k = n, %t A380728 And[w == 2, EvenQ[n]], %t A380728 k = 3; While[Or[c[k], ! CoprimeQ[k, n]], k = 2*(k - 1) + 1], %t A380728 True, k = u; While[Or[c[k], ! CoprimeQ[k, n], w != f[k]], k++] ]; %t A380728 Sow[k]; c[k] = True; %t A380728 If[k == u, While[c[u], u++]], {n, nn}] ][[-1, 1]] (* _Michael De Vlieger_, Feb 02 2025 *) %Y A380728 Cf. A000051, A005940, A048578, A085731. %K A380728 nonn,base %O A380728 1,2 %A A380728 _David James Sycamore_, Jan 31 2025 %E A380728 More terms from _Michael De Vlieger_, Feb 02 2025.