login
a(1) = 3; if n>1, and gcd(a(n-1), n) > 1 then a(n) = a(n-1)/gcd(a(n-1), n), otherwise a(n) = a(n-1) + n.
0

%I #11 Jul 13 2020 21:35:26

%S 3,5,8,2,7,13,20,5,14,7,18,3,16,8,23,39,56,28,47,67,88,4,27,9,34,17,

%T 44,11,40,4,35,67,100,50,10,5,42,21,7,47,88,44,87,131,176,88,135,45,

%U 94,47,98,49,102,17,72,9,3,61,120,2,63,125,188,47,112,56,123,191

%N a(1) = 3; if n>1, and gcd(a(n-1), n) > 1 then a(n) = a(n-1)/gcd(a(n-1), n), otherwise a(n) = a(n-1) + n.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).

%o (PARI) a(n) = if (n==1, 3, my(prec=a(n-1)); if (gcd(prec, n) > 1, prec/gcd(prec,n), n+prec)); \\ _Michel Marcus_, Jul 13 2020

%Y Cf. A093178.

%K nonn,easy

%O 1,1

%A _Todor Szimeonov_, Jul 13 2020