cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A231692 Define a sequence of rationals by f(0)=0, thereafter f(n)=f(n-1)-1/n if that is >= 0, otherwise f(n)=f(n-1)+1/n; a(n) = numerator of f(n).

This page as a plain text file.
%I A231692 #46 Aug 16 2025 23:56:42
%S A231692 0,1,1,1,5,13,1,27,19,451,199,4709,2399,3467,29207,5183,55411,221267,
%T A231692 300649,1628251,5508127,259001,762881,6460903,5694791,11476403,
%U A231692 27820203,326206681,5151783667,69088293143,146724611903,2219373406193,8951357840311,4575492601111,328329280711,4454145077671
%N A231692 Define a sequence of rationals by f(0)=0, thereafter f(n)=f(n-1)-1/n if that is >= 0, otherwise f(n)=f(n-1)+1/n; a(n) = numerator of f(n).
%C A231692 It is conjectured that the terms of the {f(n)} sequence are distinct.
%C A231692 If that is true, then the {f(n)} sequence is a fractional analog of Recamán's sequence A005132.
%C A231692 The denominators of {f(n)} form A231693 (a non-monotonic sequence).
%C A231692 From _Don Reble_, Nov 16 2013: (Start)
%C A231692 Here is a proof that the f(n) are distinct: Suppose not. Then the difference between the terms (which is zero) is a number of the form +- 1/(a+1) +- 1/(a+2) +- 1/(a+3) +- ... +- 1/(a+n).
%C A231692 Consider any harmonic sum
%C A231692    S = +- 1/(a+1) +- 1/(a+2) +- 1/(a+3) +- ... +- 1/(a+n)
%C A231692   where one puts any sign on any term, and there is at least one term. Let G be the LCM of the denominator(s). Then for any denominator D, G/D is an integer, and G*S = sum(+- G/D_i) is an integer. Let E be the highest power of two that divides G. Then there is only one multiple of E among the denominators. (If there were two, they would be consecutive multiples of E, and one would be divisible by 2*E.) Call that denominator F. So (+- G/F) is an odd integer, and for all other denominators D, (+- G/D) is an even integer. Therefore G*S is odd, therefore not zero, so S is not zero. (End)
%D A231692 David Wilson, Posting to Sequence Fans Mailing List, Nov 14 2013.
%H A231692 David W. Wilson and Reinhard Zumkeller, <a href="/A231692/b231692.txt">Table of n, a(n) for n = 0..1000</a>
%e A231692 0, 1, 1/2, 1/6, 5/12, 13/60, 1/20, 27/140, 19/280, 451/2520, 199/2520, 4709/27720, ...
%p A231692 f:=proc(n) option remember;
%p A231692 if n=0 then 0 elif
%p A231692 f(n-1) >= 1/n then f(n-1)-1/n else f(n-1)+1/n; fi; end;
%t A231692 Numerator[FoldList[# + (-1)^Boole[#*#2 >= 1]/#2 &, Range[0, 35]]] (* _Paolo Xausa_, Aug 16 2025 *)
%o A231692 (PARI) s=0;vector(30,n,numerator(s-=(-1)^(n*s<1)/n)) \\ - _M. F. Hasler_, Nov 15 2013
%o A231692 (Haskell)
%o A231692 a231692_list = map numerator $ 0 : wilson 1 0 where
%o A231692    wilson x y = y' : wilson (x + 1) y'
%o A231692                 where y' = y + (if y < 1 % x then 1 else -1) % x
%o A231692 -- _Reinhard Zumkeller_, Nov 16 2013
%Y A231692 Cf. A231693, A005132.
%K A231692 nonn,frac
%O A231692 0,5
%A A231692 _N. J. A. Sloane_, Nov 15 2013, Nov 16 2013