A360379 a(n) = number of the antidiagonal of the Wythoff array (A035513) that includes prime(n).
2, 3, 4, 3, 4, 6, 7, 8, 7, 6, 9, 8, 11, 17, 7, 21, 23, 24, 26, 13, 10, 14, 21, 10, 10, 39, 40, 13, 27, 19, 49, 12, 53, 23, 17, 37, 11, 63, 41, 14, 69, 29, 12, 47, 76, 10, 81, 35, 55, 88, 12, 92, 18, 26, 40, 101, 65, 104, 67, 108, 44, 30, 118, 75, 120, 22
Offset: 1
Examples
The first 6 antidiagonals of the Wythoff array are (1), (2,4), (3,7,6), (5,11,10,9), (8,18,16,15,12), (12,29,26,24,20,14). The 10th prime is 29, which occurs in antidiagonal 6, so a(10) = 6.
Programs
-
Mathematica
W[n_, k_] := Fibonacci[k + 1] Floor[n*GoldenRatio] + (n - 1) Fibonacci[k]; t = Table[W[n - k + 1, k], {n, 300}, {k, n, 1, -1}]; Map[#[[1]] &, Most[Reap[NestWhileList[# + 1 &, 1, Length[Sow[FirstPosition[t, Prime[#]]]] > 1 &]][[2]][[1]]]] (* Peter J. C. Moses, Feb 08 2023 *)
Comments