OFFSET
1,2
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
EXAMPLE
The leftmost digit of a(1) = 1 is 1: this digit underlines the 1st digit of a(1) which is (1);
The leftmost digit of a(2) = 10 is 1: this digit underlines the 1st digit of a(2) which is (1);
The leftmost digit of a(3) = 20 is 2: this digit underlines the 2nd digit of a(3) which is (0);
The leftmost digit of a(4) = 22 is 2: this digit underlines the 2nd digit of a(4) which is (2);
The leftmost digit of a(5) = 200 is 2: this digit underlines the 2nd digit of a(5) which is (0);
The leftmost digit of a(6) = 220 is 2: this digit underlines the 2nd digit of a(6) which is (2); etc.
We see that the parenthesized digits at the end of each line reproduce the succession of the original digits.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[If[(f=First@IntegerDigits[k])>IntegerLength@k, True, If[IntegerDigits[k][[f]]!=Flatten[IntegerDigits/@Join[Array[a, n-1], {k}]][[n]]||MemberQ[Array[a, n-1], k], True]], k++]; k); Array[a, 70] (* Giorgos Kalogeropoulos, Jul 19 2023 *)
PROG
(Python)
from itertools import count, filterfalse
def check(x):
y = str(x)
if int(y[0])> len(y): return(True)
def A364325_list(max_n):
A, S, Z, zx = [], set(), '', 0
for n in range(1, max_n+1):
for i in filterfalse(S.__contains__, count(1)):
if check(i): S.add(i)
else:
x = str(i)
u = x[int(x[0])-1]
if len(Z) == zx and u == x[0]: break
elif u == Z[zx]: break
A.append(i); S.add(i); Z += x; zx += 1
return(A) # John Tyler Rascoe, Oct 23 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Jul 18 2023
STATUS
approved