A321882 a(n) is the least base b > 1 such that the sum n + n can be computed without carry.
2, 3, 5, 3, 3, 4, 5, 5, 6, 3, 3, 5, 3, 3, 6, 7, 4, 4, 8, 8, 4, 4, 7, 7, 7, 5, 5, 3, 3, 9, 3, 3, 5, 10, 10, 5, 3, 3, 6, 3, 3, 10, 6, 6, 6, 11, 11, 11, 6, 6, 5, 5, 5, 12, 13, 5, 5, 5, 7, 7, 5, 5, 5, 7, 4, 4, 7, 8, 4, 4, 7, 7, 6, 6, 6, 8, 14, 15, 6, 6, 4, 3, 3, 8
Offset: 0
Examples
For n = 42: - in base 2, 42 + 42 cannot be computed without carry: "101010" + "101010" = "1010100", - in base 3, 42 + 42 cannot be computed without carry: "1120" + "1120" = "10010", - in base 4, 42 + 42 cannot be computed without carry: "222" + "222" = "1110", - in base 5, 42 + 42 cannot be computed without carry: "132" + "132" = "314", - in base 6, 42 + 42 can be computed without carry: "110" + "110" = "220", - hence a(42) = 6.
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..10000000 (where the color is function of the initial digit of n in base a(n))
- Index entries for sequences related to carryless arithmetic
Programs
-
Mathematica
Array[Block[{b = 2}, While[2 Max@ IntegerDigits[#, b] >= b, b++]; b] &, 84, 0] (* Michael De Vlieger, Nov 25 2018 *)
-
PARI
a(n) = for (b=2, oo, if (2*sumdigits(n, b)==sumdigits(n*2, b), return (b)))
Comments