OFFSET
2,1
COMMENTS
"More than 1 digit in base n" is equivalent to ">= n", which also implies "more than 1 digit in base 2", since n >= 2 by definition. If such a number written in binary is not a string of 1's, then its set of binary digits is {0, 1}, and the smallest number to have the same digits in base n is n = 10[n] itself. If n has all binary digits equal to 1, i.e., n = 2^k-1, then the smallest solution is the next larger number having the digits {0, 1} in base n (and also in base 2), which is, since 11[n] = n+1 is excluded, 100[n] = n^2 = (2^k-1)^2 = 2^{2k} + 2^{k+1} + 1 = 1...01[2]. - M. F. Hasler, Jan 22 2017
FORMULA
For any n>1: if n belongs to A000225, then a(n)=n^2, otherwise a(n)=n. - Rémy Sigrist, Jan 22 2017
PROG
(PARI) a(n) = my(m=n); while (Set(digits(m, n)) != Set(digits(m, 2)), m++); m;
(PARI) A281384(n) = if(n+1==1<<logint(n), n^2, n) \\ M. F. Hasler, Jan 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jan 21 2017
STATUS
approved