login
A348871
After a(1) = 1, the sequence is always extended with the smallest divisor d (not yet present in the sequence) of the last term t. If d doesn't exist, we extend the sequence with tt (t concatenated to itself). If tt doesn't produce a new d, we extend the sequence with ttt, etc. See the Comments section for more details.
4
1, 11, 111, 3, 33, 333, 9, 99, 999, 27, 2727, 101, 101101, 7, 77, 777, 21, 2121, 303, 303303, 13, 1313, 131313, 37, 3737, 373737, 39, 3939, 393939, 63, 6363, 707, 707707, 49, 4949, 494949, 91, 9191, 919191, 147, 147147, 143, 143143, 121, 121121, 847, 847847, 539, 539539, 343, 343343, 637, 637637, 169, 169169, 1001
OFFSET
1,2
EXAMPLE
a(1) = 1 by definition. As a(1) has no available divisor not yet present in the sequence, we concatenate 1 with itself to produce 11.
a(2) = 11; as 11 has no available divisor not yet present in the sequence, we concatenate 1 with 11 to produce 111.
a(3) = 111; as 111 produces the new divisor 3, we have a(4) = 3; etc.
MATHEMATICA
a[1]=1; t=1; a[n_]:=a[n]=If[b=FromDigits[Join@@IntegerDigits/@Table[a[n-t], t+1]]; Length[d=Divisors@a[n-1]]>2, If[(s=Complement[Most@Rest@d, Array[a, n-1]])!={}, t=1; Min@s, t++; b], t++; b]; Array[a, 56] (* Giorgos Kalogeropoulos, Nov 03 2021 *)
PROG
(Python)
from sympy import divisors
terms = [1]
c = 1
for i in range(100):
for j in divisors(terms[-1]):
if j not in terms:
terms.append(j)
c = j
break
else:
terms.append(int(str(terms[-1]) + str(c)))
print(terms) # Gleb Ivanov, Nov 09 2021
CROSSREFS
Cf. A000005.
Sequence in context: A356329 A055016 A259372 * A004287 A061493 A093788
KEYWORD
nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 02 2021
STATUS
approved