login
A389674
If n is a power of 10, then leave n untouched, else rewrite n in the base given by the sum of its digits, and 'read' those new digits in base 10.
2
1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1011, 110, 31, 24, 23, 22, 21, 20, 19, 10100, 210, 112, 43, 40, 34, 32, 30, 28, 27, 1010, 133, 112, 53, 46, 43, 40, 37, 35, 33, 220, 131, 110, 61, 54, 50, 46, 43, 40, 40, 200, 123, 103, 65, 60, 55, 51, 49, 46, 43, 140, 115
OFFSET
1,2
COMMENTS
The "rebase-and-read" operation is as follows:
1: Take n written in base 10, n = Sum_{i>=0} d_i * 10^i, and sum its digits together to obtain b = Sum_{i>=0} d_i.
2: If b = 1, then a(n) = n. Otherwise, "rebase": take n in base b so n = Sum_{i>=0} c_i * b^i and then "read" the digits c_i as base 10 to obtain a(n) = Sum_{i>=0} c_i * 10^i.
LINKS
EXAMPLE
For n = 8, its sum of digits is 8 and 8 = 1 * 8^1 + 0 * 8^0, so a(8) = 10.
For n = 100, its sum of the digits is 1, so by definition a(100) = 100.
For n = 1506, its sum of digits is 12 and 1506 = 10 * 12^2 + 5 * 12^1 + 6 * 12^0, so a(1506) = 10 * 10^2 + 5 * 10^1 + 6 * 10^0 = 1056.
MATHEMATICA
a[n_]:=If[IntegerQ[Log10[n]], n, FromDigits[IntegerDigits[n, DigitSum[n]]]]; Array[a, 61] (* James C. McMahon, Oct 16 2025 *)
PROG
(Python)
from sympy.ntheory import digits
def a(n): return n if (b:=sum(d:=list(map(int, str(n)))))<2 else sum(di*10**i for i, di in enumerate(digits(n, b)[:0:-1]))
print([a(n) for n in range(1, 62)]) # Michael S. Branicky, Oct 10 2025
(PARI) a(n) = my(s=sumdigits(n)); if (s==1, n, fromdigits(digits(n, s))); \\ Michel Marcus, Oct 13 2025
CROSSREFS
Cf. A007953, A011557, A326833 (fixed points).
Sequence in context: A245403 A091837 A316650 * A216875 A166710 A211872
KEYWORD
base,easy,nonn
AUTHOR
Daniel Baldwin, Oct 10 2025
STATUS
approved