OFFSET
1,3
COMMENTS
This will only work for n <= 10. To get a sequence that is defined for all n, it will be necessary to replace a(n) by a list of its "digits". So the result will be a triangle: 1 / 1 / 1,0 / 2,1,3 / ..., in which row n is a list of the digits written in base n. This should be an additional sequence with a cross-reference to this one. - N. J. A. Sloane, Sep 21 2019
See A349918 for the corresponding triangle. - Rémy Sigrist, Dec 05 2021
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10
Rémy Sigrist, PARI program for A309737
FORMULA
a(1) = 1; a(n) is the concatenation of all the previous terms, evaluated in base n-1, written in base n.
EXAMPLE
For a(3) the previous terms are {1,1}. Evaluating the concatenation of those terms in base n-1 = 2 gives 11_2 = 3; converting that to base n = 3 gives 10_3, so a(3) = 10.
n=4: 1110_3 = 39_10 = 213_4, so a(4) = 213.
PROG
(PARI) See Links section.
(Python)
from sympy.ntheory.digits import digits
def fromdigits(d, b):
n = 0
for di in d: n *= b; n += di
return n
def afull():
alst, diglst = [1], [1]
for n in range(2, 11):
andigs = digits(fromdigits(diglst, n-1), n)[1:]
alst.append(int("".join(map(str, andigs))))
diglst.extend(andigs)
return alst
print(afull()) # Michael S. Branicky, Dec 05 2021
CROSSREFS
KEYWORD
nonn,base,full,fini
AUTHOR
Moshe Levy, Aug 14 2019
EXTENSIONS
More terms from Rémy Sigrist, Dec 05 2021
STATUS
approved