A360585 The integers of the sequence appear exactly twice. Between the two copies of k there are k even integers. The sequence is always extended with the smallest integer not leading to a contradiction.
1, 2, 1, 3, 4, 5, 6, 2, 3, 7, 8, 9, 10, 4, 5, 11, 12, 13, 14, 6, 15, 16, 7, 17, 18, 19, 20, 8, 9, 21, 22, 23, 24, 10, 25, 26, 11, 27, 28, 29, 30, 12, 13, 31, 32, 33, 34, 14, 35, 36, 15, 37, 38, 39, 40, 16, 17, 41, 42, 43, 44, 18, 19, 45, 46, 47, 48, 20, 49, 50
Offset: 1
Keywords
Examples
There is one even integer between the two 1s: this is the integer 2; there are two even integers between the two 2s: they are 4 and 6; there are three even integers between the two 3s: they are 4, 6 and 2; etc.
Crossrefs
Cf. A360476.
Programs
-
Mathematica
lst={1};k=2; Do[While[FreeQ[lst,k]&&Count[lst[[First@@Position[lst,t]+1;;]],a_/;EvenQ@a]!=t,AppendTo[lst,k];k++];lst=AppendTo[lst,t],{t,25}];lst (* Giorgos Kalogeropoulos, Feb 28 2023 *)
Extensions
More terms from Jinyuan Wang, Feb 14 2023