OFFSET
0,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
Michael De Vlieger, Log-log scatterplot of A347113(n) for 1 <= n <= 2^12, showing terms in A347307 in red, those in this sequence joined in gold, and local minima in A347756 in blue
EXAMPLE
Let b(n) = A347113(n).
a(1) = 2 since b(1) = a(0) = 1.
a(k) = 2 for 1 <= k <= 7 since b(k) > 2.
a(8) = 3 since b(8) = a(7) = 2.
a(k) = 3 for 9 <= k <= 10 since b(k) > 3.
a(11) = 7 since b(11) = a(10) = 3.
a(k) = 7 for 12 <= k <= 17 since b(k) > 7, etc.
MATHEMATICA
Block[{nn = 71, a = {1}, c, k, m, u = 2, v}, v = a; Map[Set[c[#], 1] &, Union@ a]; Do[Set[k, u]; If[PrimeQ[#], m = 2; While[IntegerQ[c[m #]], m++]; k = m #, While[Or[IntegerQ[c[k]], k == #, GCD[k, #] == 1], k++]] &[a[[-1]] + 1]; AppendTo[a, k]; Set[c[k], 1]; AppendTo[v, u]; If[k == u, While[IntegerQ[c[u]], u++]], nn]; v]
(* or using A347113 bfile: *)
Block[{a, u = {1}, v = 1}, a = Import["https://oeis.org/A347113/b347113.txt", "Data"][[All, -1]]; Do[If[a[[i]] == v, While[! FreeQ[a[[1 ;; i]], v], v++]]; AppendTo[u, v], {i, Length[a]}]; u]
PROG
(Python)
from math import gcd
A347755_list, nset, m, j = [1], {1}, 2, 2
for _ in range(10**2):
k = m
while k == j or gcd(k, j) == 1 or k in nset:
k += 1
j = k + 1
nset.add(k)
A347755_list.append(m)
while m in nset:
m += 1 # Chai Wah Wu, Sep 13 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Sep 12 2021
STATUS
approved