A387078 Run lengths of A386482(n) mod 2 == n mod 2.
1, 3, 2, 4, 2, 3, 3, 5, 3, 4, 2, 8, 5, 3, 4, 4, 2, 11, 4, 2, 2, 22, 16, 5, 3, 1, 2, 12, 6, 31, 14, 4, 3, 8, 3, 28, 2, 37, 14, 10, 12, 9, 2, 41, 7, 61, 24, 24, 2, 134, 71, 51, 97, 3, 2, 127, 69, 39, 15, 64, 55, 56, 26, 100, 37, 32, 40, 33, 2, 440, 107, 196, 391
Offset: 1
Keywords
Examples
S begins as follows, grouping odd terms in brackets [], and even in parentheses (): [1], (2, 4, 6), [3, 9], (12, 10, 8, 14), [7, 21], (18, 16, 20), [15, 5, 25], ... This sequence takes run lengths in the order they appear, therefore a(1) = 1, a(2) = 3, a(3) = 2, a(4) = 4, a(5) = 2, etc. Hence a(n) for odd n pertains to run lengths of odd terms in S, while a(n) for even n pertains to run lengths of even terms in same.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..183 (run lengths available given 2^20 terms of S).
Crossrefs
Cf. A386482.
Programs
-
Mathematica
Block[{c, j, k, m, p, r, nn}, nn = 2^12; c[] := False; m[] := 1; j = 2; c[1] = c[2] = True; r = 1; {1}~Join~Monitor[Most@ Reap[Do[ If[PrimePowerQ[j], Set[{p, k, m}, {#1, #1^(#2 - 1), #1^(#2 - 1)}] & @@ FactorInteger[j][[1]]; While[And[c[k*p], k != 0], k--]; If[k == 0, k = m; While[c[k*p], k++]]; k *= p, k = j - 1; While[And[Or[c[k], CoprimeQ[j, k]], k != 1], k--]; If[k == 1, k += j; While[Or[c[k], CoprimeQ[j, k] ], k++] ] ]; If[Mod[j, 2] == Mod[k, 2], r++, Sow[r]; r = 1]; Set[{c[k], j}, {True, k}], {n, 3, nn}] ][[-1, 1]], n] ]
Comments