A351498 Position k of first term in a run of odd terms with length > 1 in A093714.
1, 10, 17, 78, 1787, 15022, 38123, 45052, 1036043
Offset: 1
Examples
S(1) = 1 and S(2) = 3, therefore this sequence begins with 1. S(10) = 13 and S(11) = 9, therefore 10 is in this sequence. S(17) = 23 and S(18) = 15, therefore 17 is in this sequence. For 2 <= k <= 10, S(k) and k have different parity, but for 11 <= k <= 17, S(k) and k have the same parity.
Programs
-
Mathematica
nn = 2^20, c = {1}, j = 1, s = 0; t = {}; u = 2; Reap[Do[k = u; While[Nand[FreeQ[c, k], CoprimeQ[j, k], k != j + 1], k++]; j = k; AppendTo[c, k]; If[# != s, s = #; Sow[i - 1]] &@ Mod[Abs[k - i], 2]; If[k == u, While[MemberQ[c, u], u++]; c = DeleteCases[c, _?(# < u &)]], {i, 2, nn}] ][[-1, -1]]
Comments