OFFSET
1,1
COMMENTS
This is not an injective function. a(2) = a(25) = 8.
a(n) > 3.
EXAMPLE
a(1) = 4 since 2^4 = 16 starts with 1 and is not 1 itself (the way 2^0 = 1 would be);
a(2) = 8 (not 1: 2^1 = 2) since 2^8 = 256;
a(3) = 5 since 2^5 = 32;
a(4) = 12 (not 2: 2^2 = 4) since 2^12 = 4096;
a(5) = 9 since 2^9 = 512; etc.
MATHEMATICA
a[n_] := Block[{j = IntegerLength@ n, k = 1}, While[ IntegerLength[2^k] < j || Quotient[2^k, 10^(IntegerLength[2^k] - j)] != n || n == 2^k, k++]; k]; Array[ a, 70]
PROG
(Python)
def A363873(n):
m, s = 1<<(k:=n.bit_length()-1), str(n)
while m<=n or not str(m).startswith(s):
k += 1
m <<= 1
return k # Chai Wah Wu, Aug 06 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Jul 03 2023
STATUS
approved