|
|
A338625
|
|
a(1) = 1; for n > 1, ceiling(a(n-1)/2)+3 if a(n-1) and n are coprime, otherwise a(n) = GCD(a(n-1),n)*2+1.
|
|
0
|
|
|
1, 4, 5, 6, 6, 13, 10, 5, 6, 5, 6, 13, 27, 17, 12, 9, 8, 5, 6, 5, 6, 5, 6, 13, 10, 5, 6, 5, 6, 13, 10, 5, 6, 5, 11, 9, 8, 5, 6, 5, 6, 13, 10, 5, 11, 9, 8, 17, 12, 5, 6, 5, 6, 13, 10, 5, 6, 5, 6, 13, 10, 5, 6, 5, 11, 23, 15, 11, 9, 8, 7, 7, 7, 7, 7, 7, 15, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(2) = 4. Because a(1) = 1 and 2 are coprime: ceiling(1/2)+3 = 4.
|
|
MATHEMATICA
|
Nest[Append[#1, If[GCD[#1[[-1]], #2] == 1, Ceiling[#1[[-1]]/2] + 3, 2 GCD[#1[[-1]], #2] + 1]] & @@ {#, Length[#] + 1} &, {1}, 77] (* Michael De Vlieger, Nov 04 2020 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|