A350315 Length of the rows of the Redstone permutation A350313.
2, 3, 6, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 12, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 12, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4, 6, 6, 6, 8, 4
Offset: 1
Keywords
Programs
-
Mathematica
s = {2, 1}; c[] = 0; Array[Set[c[s[[#]]], #] &, Length[s]]; j = Last[s]; u = 3; Prepend[Differences[#], First[#]] &[{2}~Join~Reap[Monitor[Do[If[j == u, While[c[u] > 0, u++]]; k = u; While[Nand[c[k] == 0, CoprimeQ[i, k], ! Divisible[i - 1, k]], k++]; If[k == u, Sow[i]]; Set[c[k], i]; j = k, {i, Length[s] + 1, 500}], i]][[-1, -1]]] (* _Michael De Vlieger, Dec 24 2021 *)
Formula
Apparently for n >= 4: a(n) = 2 * b(n - 4) + 6, where the generating function of b(n) is (-3*x^33 + x^29 - x^28 + x^24 - x^23 + x^19 - x^18 + x^14 - x^13 + x^9 - x^8 + x^4 - x^3)/(x^34 - 1).
Comments