OFFSET
1,1
COMMENTS
The pattern of solutions for each binary representation is notable. For 1001= decimal 9, the bases as solutions are 5,8,11,14,... whereas the pattern for 111=decimal 7 is 4,9,11,16,18,....
The binary representation of n corresponds to the unique polynomial p_n(x) with coefficients in {0,1} such that p(2) = n. a(n) is the least x >= 3 such that p_n(x) == 0 mod n. Thus 3 <= a(n) <= n + 2. - Robert Israel, Dec 15 2014
From Rémy Sigrist, Mar 15 2017: (Start)
If n is even then a(n) <= max(4, n).
If n is odd then a(n) <= n + 2.
If n is odd then n and a(n) are coprime.
If a(n)=4 then n belongs to A062846.
(End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
It is simply a matter of converting a binary number to another base to see if the resulting number is a multiple of n. The lowest other base is listed.
EXAMPLE
The n-th term is solved by converting the decimal n to binary then asking to what other base is this representation a multiple of n. For the 5th term, the binary representation is 101; if this is converted to base 3, 101 = 9+0+1 = 10, a multiple of 5. The base 3 is the first base producing a multiple of n: the 5th term is therefore 3.
MAPLE
A155078 := proc(n) local bdgs, b ; bdgs := convert(n, base, 2) ; for b from 3 do add(op(i, bdgs)*b^(i-1), i=1..nops(bdgs)) ; if mod n = 0 then RETURN(b); fi; od: end: seq(A155078(n), n=1..100) ; # R. J. Mathar, Mar 14 2009
# second Maple program:
f:= proc(n) local b, L, r, sols;
L:= convert(n, base, 2);
r:= add(L[i]*b^(i-1), i=1..nops(L));
sols:= subs(0=n, 1=n+1, 2=n+2, map(t -> rhs(op(t)), {msolve(r, n)})) ;
min(sols);
end proc:
3, seq(f(n), n=2..100); # Robert Israel, Dec 15 2014
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
J. M. Bergot, Jan 19 2009
EXTENSIONS
Corrected and extended by R. J. Mathar, Mar 14 2009
STATUS
approved