OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10001
EXAMPLE
a(2) = 8 because in base 5, 8 = 13_5 and 16 = 31_5.
a(3) = 18 because in base 4, 18 = 102_4 and 36 = 210_4.
MATHEMATICA
fQ[n_] := Block[{b = 2}, While[ 2b < n +3 && Sort[ IntegerDigits[n, b]] != Sort[ IntegerDigits[ 2n, b]], b++]; 2b < n +3]; fQ[0] = True; Select[Range[0, 435], fQ] (* Robert G. Wilson v, Dec 21 2016 *)
PROG
(PARI) isok(n) = if (n==0, 1, for (b=2, n, if (vecsort(digits(n, b)) == vecsort(digits(2*n, b)), return(1))); 0); \\ Michel Marcus, Dec 17 2016
CROSSREFS
KEYWORD
AUTHOR
Peter Kagey, Dec 17 2016
STATUS
approved