OFFSET
0,3
COMMENTS
This sequence is a permutation of the nonnegative integers with inverse A341910.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8191
Rémy Sigrist, Colored scatterplot of the first 2^16 terms (where the color is function of A000120(n))
Rémy Sigrist, PARI program for A341911
EXAMPLE
The first terms, in decimal and in binary, are:
n a(n) bin(n) bin(a(n))
-- ---- ------- ---------
0 0 0 0
1 1 1 1
2 3 10 11
3 2 11 10
4 7 100 111
5 4 101 100
6 6 110 110
7 5 111 101
8 15 1000 1111
9 8 1001 1000
10 12 1010 1100
MATHEMATICA
Block[{a = {0}, k}, Do[k = 1; While[Nand[FreeQ[a, k], Length[Split@ IntegerDigits[k, 2]] == #], k++] &@ DigitCount[i, 2, 1]; AppendTo[a, k], {i, 66}]; a] (* Michael De Vlieger, Feb 24 2021 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Feb 23 2021
STATUS
approved