Skip to main content
added 643 characters in body
Source Link
MarcMush
  • 6.6k
  • 13
  • 17

Julia, 1818 24 bytes

n->ndigits(n^n,base=2)-1

Try it online!

port of Manish Kundu's answer

previous answer:

n->floor(log2(n)n)

Try it online!

input needs to be a BigInt to avoid floating point errors.

Technically invalid because you need to augment the precision for very big numbers (with setprecision(2048) for example for 10^100)

Julia, 18 bytes

n->floor(log2(n)n)

Try it online!

input needs to be a BigInt to avoid floating point errors

Julia, 18 24 bytes

n->ndigits(n^n,base=2)-1

Try it online!

port of Manish Kundu's answer

previous answer:

n->floor(log2(n)n)

Try it online!

input needs to be a BigInt to avoid floating point errors.

Technically invalid because you need to augment the precision for very big numbers (with setprecision(2048) for example for 10^100)

Source Link
MarcMush
  • 6.6k
  • 13
  • 17

Julia, 18 bytes

n->floor(log2(n)n)

Try it online!

input needs to be a BigInt to avoid floating point errors