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.

A123684 Alternate A016777(n) with A000027(n).

This page as a plain text file.
%I A123684 #67 Apr 14 2025 11:59:57
%S A123684 1,1,4,2,7,3,10,4,13,5,16,6,19,7,22,8,25,9,28,10,31,11,34,12,37,13,40,
%T A123684 14,43,15,46,16,49,17,52,18,55,19,58,20,61,21,64,22,67,23,70,24,73,25,
%U A123684 76,26,79,27,82,28,85,29,88,30,91,31,94,32,97,33,100,34,103,35,106,36
%N A123684 Alternate A016777(n) with A000027(n).
%C A123684 a(n) is a diagonal of Table A123685.
%C A123684 The arithmetic average of the first n terms gives the positive integers repeated (A008619). - _Philippe Deléham_, Nov 20 2013
%C A123684 Images under the modified '3x-1' map: a(n) = n/2 if n is even, (3n-1)/2 if n is odd. (In this sequence, the numbers at even indices n are n/2 [A000027], and the numbers at odd indices n are 3((n-1)/2) + 1 [A016777] = (3n-1)/2.) The latter correspondence interestingly mirrors an insight in David Bařina's 2020 paper (see below), namely that 3(n+1)/2 - 1 = (3n+1)/2. - _Kevin Ge_, Oct 30 2024
%H A123684 Reinhard Zumkeller, <a href="/A123684/b123684.txt">Table of n, a(n) for n = 1..10000</a>
%H A123684 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%H A123684 David Bařina, <a href="https://link.springer.com/article/10.1007/s11227-020-03368-x">Convergence verification of the Collatz problem</a>
%F A123684 From _Klaus Brockhaus_, May 12 2007: (Start)
%F A123684 G.f.: x*(1+x+2*x^2)/((1-x)^2*(1+x)^2).
%F A123684 a(n) = (1/4)*(4*n - 1 - (2*n - 1)*(-1)^n).
%F A123684 a(2n-1) = A016777(n-1) = 3(n-1) + 1.
%F A123684 a(2n) = A000027(n) = n.
%F A123684 a(n) = A071045(n-1) + 1.
%F A123684 a(n) = A093005(n) - A093005(n-1) for n > 1.
%F A123684 a(n) = A105638(n+2) - A105638(n+1) for n > 1.
%F A123684 a(n) = A092530(n) - A092530(n-1) - 1.
%F A123684 a(n) = A031878(n+1) - A031878(n) - 1. (End)
%F A123684 a(2*n+1) + a(2*n+2) = A016825(n). - _Paul Curtz_, Mar 09 2011
%F A123684 a(n)= 2*a(n-2) - a(n-4). - _Paul Curtz_, Mar 09 2011
%F A123684 From _Jaroslav Krizek_, Mar 22 2011 (Start):
%F A123684 a(n) = n + a(n-1) for odd n; a(n) = n - A064455(n-1) for even n.
%F A123684 a(n) = A064455(n) - A137501(n).
%F A123684 Abs(a(n) - A064455(n)) = A052928(n). (End)
%F A123684 a(n) = A225126(n) for n > 1. - _Reinhard Zumkeller_, Apr 29 2013
%F A123684 a(n) = Sum_{k=1..n} (1 + (k-1)*(-1)^(k-1)). - _Bruno Berselli_, Jul 16 2013
%F A123684 a(n) = n + floor(n/2) for odd n; a(n) = n/2 for even n. - _Reinhard Muehlfeld_, Jul 25 2014
%e A123684 The natural numbers begin 1, 2, 3, ... (A000027), the sequence 3*n + 1 begins 1, 4, 7, 10, ... (A016777), therefore A123684 begins 1, 1, 4, 2, 7, 3, 10, ...
%e A123684 1/1 = 1, (1+1)/2 = 1, (1+1+4)/3 = 2, (1+1+4+2)/4 = 2, ... - _Philippe Deléham_, Nov 20 2013
%p A123684 A123684:=n->n-1/4-(1/2*n-1/4)*(-1)^n: seq(A123684(n), n=1..70); # _Wesley Ivan Hurt_, Jul 26 2014
%t A123684 CoefficientList[Series[(1 +x +2*x^2)/((1-x)^2*(1+x)^2), {x,0,70}], x] (* _Wesley Ivan Hurt_, Jul 26 2014 *)
%t A123684 LinearRecurrence[{0,2,0,-1},{1,1,4,2},80] (* _Harvey P. Dale_, Apr 14 2025 *)
%o A123684 (Magma) &cat[ [ 3*n-2, n ]: n in [1..36] ]; // _Klaus Brockhaus_, May 12 2007
%o A123684 (PARI) print(vector(72, n, if(n%2==0, n/2, (3*n-1)/2))) \\ _Klaus Brockhaus_, May 12 2007
%o A123684 (PARI) print(vector(72, n, n-1/4-(1/2*n-1/4)*(-1)^n)); \\ _Klaus Brockhaus_, May 12 2007
%o A123684 (Haskell)
%o A123684 import Data.List (transpose)
%o A123684 a123684 n = a123684_list !! (n-1)
%o A123684 a123684_list = concat $ transpose [a016777_list, a000027_list]
%o A123684 -- _Reinhard Zumkeller_, Apr 29 2013
%o A123684 (Magma) /* From the fourteenth formula: */ [&+[1+k*(-1)^k: k in [0..n]]: n in [0..80]]; // _Bruno Berselli_, Jul 16 2013
%o A123684 (SageMath) [(n + (2*n-1)*(n%2))//2 for n in range(1,71)] # _G. C. Greubel_, Mar 15 2024
%Y A123684 Cf. A000027, A008619, A016777, A016825, A031878, A052928, A064455.
%Y A123684 Cf. A071045, A092530, A093005, A105638, A123685, A137501, A225126.
%Y A123684 Cf. A014682 (modified Collatz map)
%K A123684 nonn,easy
%O A123684 1,3
%A A123684 _Alford Arnold_, Oct 11 2006
%E A123684 More terms from _Klaus Brockhaus_, May 12 2007