OFFSET
1,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..16384
Michael De Vlieger, Log log scatterplot of log_2(a(n)), n = 2..2^14.
FORMULA
a(a(n)) = n for all n.
EXAMPLE
a(1) = 1, the smallest novel number coprime to 1 and having same binary weight (1)
a(3) = 5, since weight(3) = weight(5) = 2 and gcd(2,5) = 1, and 5 is least such number.
a(5) = 3 (sequence is self inverse).
MATHEMATICA
nn = 2^13; c[_] := False; u = 1;
f[x_] := f[x] = DigitCount[x, 2, 1];
Reap[Do[w = f[n];
Which[w == 1, k = n,
And[w == 2, EvenQ[n]],
k = 3; While[Or[c[k], ! CoprimeQ[k, n]], k = 2*(k - 1) + 1],
True, k = u; While[Or[c[k], ! CoprimeQ[k, n], w != f[k]], k++] ];
Sow[k]; c[k] = True;
If[k == u, While[c[u], u++]], {n, nn}] ][[-1, 1]] (* Michael De Vlieger, Feb 02 2025 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David James Sycamore, Jan 31 2025
EXTENSIONS
More terms from Michael De Vlieger, Feb 02 2025.
STATUS
approved
