A355506 a(n) is the least positive integer not occurring earlier in the sequence such that, if a(m) = a(n)+1, then |m - n| >= a(n).
1, 2, 4, 6, 8, 3, 10, 12, 5, 14, 16, 7, 18, 20, 22, 9, 24, 26, 11, 28, 30, 32, 13, 34, 36, 15, 38, 40, 42, 17, 44, 46, 19, 48, 50, 21, 52, 54, 56, 23, 58, 60, 25, 62, 64, 66, 27, 68, 70, 29, 72, 74, 31, 76, 78, 80, 33, 82, 84, 35, 86, 88, 90, 37, 92, 94, 39, 96, 98, 41, 100, 102, 104, 43, 106
Offset: 1
Keywords
Examples
The distance between a(3) = 4 and a(9) = 5 is |3 - 9| = 6, which is >= 4.
Programs
-
PARI
{A355506_first(N, U=1/*starting value*/, A=Map())=vector(N, n, my(k=U); while(mapisdefined(A,k) || iferr(n < mapget(A,k-1)+k-1 || n
2 && mapdelete(A,U-2); U++); k)} \\ M. F. Hasler, Jul 05 2022
Extensions
More terms from M. F. Hasler, Jul 04 2022
Comments