Talk:Calkin-Wilf sequence: Difference between revisions

Content added Content deleted
(q0)
(→‎Off by one error?: Index starts from one.)
Line 23: Line 23:


: When I try this, I get 'error, ith_term has not been defined'. To be slightly less churlish, I see wp defines "starting from q1 = 1" and there simply is no "zeroth" term. A q0 of 1 is just as wrong, in fact even wronger, and I'd like to see that ith_term - if it ''is'' using the formula I see on wp and in the task description it would a) be wrong and b) not be possible without assuming a q0 of 0. In my entry I cheekily went printf(1,"The first 21 terms of the Calkin-Wilf sequence are:\n 0: 0\n") just to match everyone else. Perhaps the task could be amended to say "you can quietly assume a q0 of 0 to simplify calculations but '''do not show it'''". Lastly, when you say "seems off by one" the wikipedia page clearly links 4/3 and 9 and 3/4 and 14 so... --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 00:37, 29 December 2020 (UTC)
: When I try this, I get 'error, ith_term has not been defined'. To be slightly less churlish, I see wp defines "starting from q1 = 1" and there simply is no "zeroth" term. A q0 of 1 is just as wrong, in fact even wronger, and I'd like to see that ith_term - if it ''is'' using the formula I see on wp and in the task description it would a) be wrong and b) not be possible without assuming a q0 of 0. In my entry I cheekily went printf(1,"The first 21 terms of the Calkin-Wilf sequence are:\n 0: 0\n") just to match everyone else. Perhaps the task could be amended to say "you can quietly assume a q0 of 0 to simplify calculations but '''do not show it'''". Lastly, when you say "seems off by one" the wikipedia page clearly links 4/3 and 9 and 3/4 and 14 so... --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 00:37, 29 December 2020 (UTC)

:: I read the wp entry some more as well as others, and I agree, there is no zero'th indexed item. The series ''starts from the 1-indexed item which has a value of 1''. Different methods of arriving at the i'th term, for i being one of all positive integers '''not''' including zero, agree. Extrapolating to a zero'th term do not, and have no meaning in terms of the tree that is traversed to form the series.
:: I could amend the task description... --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:24, 29 December 2020 (UTC)