OFFSET
1,2
EXAMPLE
Given the 5th term in the sequence, the next (6th) term is the 5th term plus the result obtained by taking the 5th term's digits in order in base 6 (the index of the next term) and incrementing the base by 1 without changing the digits.
In this example, a(5) = 19 = 31_6; incrementing the base of 31_6 without changing the digits gives 31_7 = 22, and a(6) = a(5) + 22 = 19 + 22 = 41.
.
digits
of a(n-1)
a(n-1) interpreted
in in base n+1
n a(n-1) base n = k k + a(n-1) = a(n)
- ------ ------ ----------- -------------------
1 1
2 1 1_2 1_3 = 1 1 + 1 = 2
3 2 2_3 2_4 = 2 2 + 2 = 4
4 4 10_4 10_5 = 5 5 + 4 = 9
5 9 14_5 14_6 = 10 10 + 9 = 19
6 19 31_6 31_7 = 22 22 + 19 = 41
7 41 56_7 56_8 = 46 46 + 41 = 87
8 87 127_8 127_9 = 106 106 + 87 = 193
MATHEMATICA
a[n_] := a[n] = a[n-1] + FromDigits[ IntegerDigits[ a[n-1], n], n + 1]; Array[a, 33] (* Giovanni Resta, Dec 16 2019 *)
PROG
(PARI) lista(nn) = {my(a = 1); print1(a, ", "); for (n=2, nn, a += fromdigits(digits(fromdigits(digits(a, n), n+1))); print1(a, ", "); ); } \\ Michel Marcus, Dec 16 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Tristan Young, Dec 15 2019
STATUS
approved