login
A380756
a(n) is the smallest number not yet in the sequence which is coprime to n and has the same number of 0's in its binary expansion as n.
1
1, 5, 7, 9, 2, 11, 3, 17, 4, 19, 6, 25, 14, 13, 31, 33, 8, 35, 10, 37, 22, 21, 27, 41, 12, 43, 23, 39, 30, 29, 15, 65, 16, 67, 18, 73, 20, 49, 28, 69, 24, 71, 26, 75, 46, 45, 55, 97, 38, 77, 53, 83, 51, 79, 47, 85, 58, 57, 61, 91, 59, 95, 127, 129, 32, 131, 34, 133
OFFSET
1,2
COMMENTS
a(n) is the smallest novel number coprime to n with A023416(a(n)) = A023416(n). Sequence is self inverse and conjectured to be a permutation of the positive integers.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16.
Michael De Vlieger, Log log scatterplot of a(n), n = 2^15..2^16-1, enlarging a portion of the seemingly repetitive details of the above graph.
FORMULA
a(a(n)) = n for all n; a(2^k) = 2^(k+1) + 1, (k >= 1); a(2^k + 1) = 2^(k-1), (k > 1).
EXAMPLE
a(1) = 1, the smallest novel number coprime to 1, and A023416(1) = A023416(1) = 0.
a(2) = 5, the smallest novel number coprime to 2, and A023416(2) = A023416(5) = 1.
a(3) = 7, the smallest novel number prime to 3, and A023416(3) = A023416(7) = 0.
MATHEMATICA
nn = 120; c[_] := False; u = 1;
f[x_] := f[x] = DigitCount[x, 2, 0];
Reap[Do[w = f[n]; 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 *)
PROG
(PARI) first(n) = {
my(res = vector(n), c = 0);
for(i = 1, n,
qzeros = A023416(i);
for(j = 1, oo,
if(bitand(c, 1<<j) == 0 && gcd(j, i) == 1 && A023416(j) == qzeros,
res[i] = j;
c = bitor(c, 1<<j);
next(2)
);
);
); res
}
A023416(n) = if(n == 0, 1, 1+logint(n, 2) - hammingweight(n)) \\ David A. Corneth, Feb 02 2025, A023416 from Gheorghe Coserea, Sep 01 2015
CROSSREFS
Sequence in context: A388801 A296490 A290151 * A117031 A394838 A068456
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from David A. Corneth, Feb 02 2025
STATUS
approved