login
A349183
a(1) = 1; for n>1, a(n) = smallest divisor d of a(n-1) not yet present in the sequence. If no such d exists, a(n) = 2*A007947(a(n-1)) + 1.
0
1, 3, 7, 15, 5, 11, 23, 47, 95, 19, 39, 13, 27, 9, 7, 15, 31, 63, 21, 43, 87, 29, 59, 119, 17, 35, 71, 143, 287, 41, 83, 167, 335, 67, 135, 45, 31, 63, 43, 87, 175, 25, 11, 23, 47, 95, 191, 383, 767, 1535, 307, 615, 123, 247, 495, 33, 67, 135, 31, 63, 43
OFFSET
1,2
COMMENTS
Enters a loop starting at n = 420: [211, 423, 283, 567, 43, 87, 175, 71, 143, 287, 575, 231, 463, 927, 619, 1239, 2479, 4959, 3307, 6615].
MATHEMATICA
m = d[1] = 1; {1}~Join~Reap[Do[Set[n, If[IntegerQ@ #1, #1, 1 + 2 SelectFirst[Reverse@ #2, SquareFreeQ]]] & @@ {SelectFirst[#, ! IntegerQ[d[#]] &], #} &@ Divisors[m]; Sow[n]; Set[d[n], i]; m = n, {i, 2, 61}]][[-1, -1]] (* Michael De Vlieger, Nov 09 2021 *)
PROG
(Python)
from sympy import primefactors, prod, divisors
terms = [1]
for i in range(100):
for j in divisors(terms[-1]):
if j not in terms:
terms.append(j)
break
else:
terms.append(prod(primefactors(terms[-1]))*2+1)
print(terms)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gleb Ivanov, Nov 09 2021
STATUS
approved