login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(1)=1, a(2)=2. Thereafter a(n+1) is the smallest k such that gcd(k, a(n)) > 1, and gcd(k, s(n)) = 1, where s(n) is the n-th partial sum.
1

%I #11 Oct 21 2022 15:12:48

%S 1,2,4,6,3,9,12,8,14,7,35,5,15,10,16,20,18,21,27,24,22,11,33,30,25,55,

%T 40,26,13,39,36,28,32,34,17,51,45,57,19,133,38,44,46,23,69,42,48,50,

%U 52,54,56,49,63,60,58,29,87,66,62,31,93,72,64,68,70,65,75,78

%N a(1)=1, a(2)=2. Thereafter a(n+1) is the smallest k such that gcd(k, a(n)) > 1, and gcd(k, s(n)) = 1, where s(n) is the n-th partial sum.

%C Conjectured to be a permutation of the positive integers.

%H Michael De Vlieger, <a href="/A357777/a357777.png">Log-log scatterplot of a(n)</a>, n = 1..2^14, labeling records in red, local minima in blue, highlighting prime terms in green, prime partial sums in gold and labeling those in orange italics.

%e a(3) = 4 because 4 is the smallest number which has not occurred already which is prime to s(2)=3 and shares a divisor (2) with a(2)=2.

%t nn = 68; c[_] = False; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; u = s = 3; Do[j = a[n - 1]; k = u; If[CoprimeQ[j, s], While[Nand[! c[k], CoprimeQ[k, s], ! CoprimeQ[j, k], k != s], k++]]; Set[{a[n], c[k]}, {k, True}]; s += k; If[k == u, While[c[u], u++]], {n, 3, nn}]; Array[a, nn] (* _Michael De Vlieger_, Oct 13 2022 *)

%Y Cf. A064413, A357735.

%K nonn

%O 1,2

%A _David James Sycamore_, Oct 12 2022