OFFSET
0,1
COMMENTS
Apparently, a(n) is also the least base b > 1 where the square of the digital sum of n equals the digital sum of the square of n.
The sequence is well defined as, for any n > 0, n * n can be computed without carry in base n^2 + 1.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Rémy Sigrist, Colored scatterplot of (n, a(n)) for n = 0..50000 (where the color is function of the initial digit of n in base a(n))
MATHEMATICA
Array[Block[{b = 2}, While[AnyTrue[With[{d = IntegerDigits[#, b]}, Function[{s, t}, Total@ Map[PadLeft[#, t] &, s]] @@ {#, Max[Length /@ #]} &@ MapIndexed[Join[d #, ConstantArray[0, First@ #2 - 1]] &, Reverse@ d]], # >= b &], b++]; b] &, 79, 0] (* Michael De Vlieger, Nov 25 2018 *)
PROG
(PARI) a(n) = for (b=2, oo, my (d=if(n==0, [0], digits(n, b))); if (vecmax(d)^2<b, my (s=0, ok=1); forstep (i=#d, 1, -1, s \= b; my (t=d[i]*n); if (sumdigits(s+t, b)==sumdigits(s, b)+sumdigits(t, b), s += t, ok = 0; break)); if (ok, return (b))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 21 2018
STATUS
approved