OFFSET
1,1
COMMENTS
For any prime number p, a(p) is the least of the binary concatenation of p with 1 or the binary concatenation of 1 with p.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
The first terms, alongside their binary expansion split into two parts, are:
n a(n) bin(a(n))
-- ---- ---------
1 3 1|1
2 5 10|1
3 7 11|1
4 9 100|1
5 11 101|1
6 11 10|11
7 15 111|1
8 17 1000|1
9 15 11|11
10 21 1010|1
11 23 1011|1
12 19 100|11
13 27 1101|1
14 23 10|111
15 23 101|11
MATHEMATICA
Table[Min@ Map[FromDigits[Join @@ #, 2] &, Join @@ {#, Reverse /@ #}] &@ Map[IntegerDigits[#, 2] &, Transpose@{#, n/#}, {2}] &@ TakeWhile[Divisors[n], # <= Sqrt[n] &], {n, 60}] (* Michael De Vlieger, Apr 07 2023 *)
PROG
(PARI) a(n, base = 2) = { my (v = oo); fordiv (n, d, v = min(v, n/d * base^#digits(d, base) + d); ); return (v); }
(Python)
from sympy import divisors
def a(n): return min(d+((n//d)<<d.bit_length()) for d in divisors(n))
print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Apr 05 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 05 2023
STATUS
approved