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.
%I A006368 M2249 #150 Dec 18 2024 09:21:50 %S A006368 0,1,3,2,6,4,9,5,12,7,15,8,18,10,21,11,24,13,27,14,30,16,33,17,36,19, %T A006368 39,20,42,22,45,23,48,25,51,26,54,28,57,29,60,31,63,32,66,34,69,35,72, %U A006368 37,75,38,78,40,81,41,84,43,87,44,90,46,93,47,96,49,99,50,102,52,105,53 %N A006368 The "amusical permutation" of the nonnegative numbers: a(2n)=3n, a(4n+1)=3n+1, a(4n-1)=3n-1. %C A006368 A permutation of the nonnegative integers. %C A006368 There is a famous open question concerning the closed trajectories under this map - see A217218, A028393, A028394, and Conway (2013). %C A006368 This is lodumo_3 of A131743. - _Philippe Deléham_, Oct 24 2011 %C A006368 Multiples of 3 interspersed with numbers other than multiples of 3. - _Harvey P. Dale_, Dec 16 2011 %C A006368 For n>0: a(2n+1) is the smallest number missing from {a(0),...,a(2n-1)} and a(2n) = a(2n-1) + a(2n+1). - _Bob Selcoe_, May 24 2017 %C A006368 From _Wolfdieter Lang_, Sep 21 2021: (Start) %C A006368 The permutation P of positive natural numbers with P(n) = a(n-1) + 1, for n >= 1, is the inverse of the permutation given in A265667, and it maps the index n of A178414 to the index of A047529: A178414(n) = A047529(P(n)). %C A006368 Thus each number {1, 3, 7} (mod 8) appears in the first column A178414 of the array A178415 just once. For the formulas see below. (End) %C A006368 Starting at n = 1, the sequence equals the smallest unused positive number such that a(n)-a(n-1) does not appear as a term in the current sequence. - _Scott R. Shannon_, Dec 20 2023 %D A006368 J. H. Conway, Unpredictable iterations, in Proc. Number Theory Conf., Boulder, CO, 1972, pp. 49-52. %D A006368 R. K. Guy, Unsolved Problems in Number Theory, E17. %D A006368 J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 5. %D A006368 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006368 R. Zumkeller, <a href="/A006368/b006368.txt">Table of n, a(n) for n = 0..10000</a> %H A006368 David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, <a href="http://arxiv.org/abs/1501.01669">The Yellowstone Permutation</a>, arXiv preprint arXiv:1501.01669 [math.NT], 2015 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Sloane/sloane9.html">J. Int. Seq. 18 (2015) 15.6.7</a>.. %H A006368 J. H. Conway, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.120.03.192">On unsettleable arithmetical problems</a>, Amer. Math. Monthly, 120 (2013), 192-198. [Introduces the name "amusical permutation".] %H A006368 Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009. %H A006368 Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992 %H A006368 S. Schreiber & N. J. A. Sloane, <a href="/A006368/a006368.pdf">Correspondence, 1980</a> %H A006368 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %H A006368 <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a> %H A006368 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %H A006368 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1). %F A006368 If n even, then a(n) = 3*n/2, otherwise, a(n) = round(3*n/4). %F A006368 G.f.: x*(1+3*x+x^2+3*x^3+x^4)/((1-x^2)*(1-x^4)). - _Michael Somos_, Jul 23 2002 %F A006368 a(n) = -a(-n). %F A006368 From _Reinhard Zumkeller_, Nov 20 2009: (Start) %F A006368 a(n) = A006369(n) - A168223(n). %F A006368 A168221(n) = a(a(n)). %F A006368 A168222(a(n)) = A006369(n). (End) %F A006368 a(n) = a(n-2) + a(n-4) - a(n-6); a(0)=0, a(1)=1, a(2)=3, a(3)=2, a(4)=6, a(5)=4. - _Harvey P. Dale_, Dec 16 2011 %F A006368 From _Wolfdieter Lang_, Sep 21 2021: (Start) %F A006368 Formulas for the permutation P(n) = a(n-1) + 1 mentioned above: %F A006368 P(n) = n + floor(n/2) if n is odd, and n - floor(n/4) if n is even. %F A006368 P(n) = (3*n-1)/2 if n is odd; P(n) = (3*n+2)/4 if n == 2 (mod 4); and P(n) = 3*n/4 if n == 0 (mod 4). (End) %e A006368 9 is odd so a(9) = round(3*9/4) = round(7-1/4) = 7. %p A006368 f:=n-> if n mod 2 = 0 then 3*n/2 elif n mod 4 = 1 then (3*n+1)/4 else (3*n-1)/4; fi; # _N. J. A. Sloane_, Jan 21 2011 %p A006368 A006368:=(1+3*z+z**2+3*z**3+z**4)/(1+z**2)/(z-1)**2/(1+z)**2; # [Conjectured (correctly, except for the offset) by _Simon Plouffe_ in his 1992 dissertation.] %t A006368 Table[If[EvenQ[n],(3n)/2,Floor[(3n+2)/4]],{n,0,80}] (* or *) LinearRecurrence[ {0,1,0,1,0,-1},{0,1,3,2,6,4},80] (* _Harvey P. Dale_, Dec 16 2011 *) %o A006368 (PARI) a(n)=(3*n+n%2)\(2+n%2*2) %o A006368 (PARI) a(n)=if(n%2,round(3*n/4),3*n/2) %o A006368 (Haskell) %o A006368 a006368 n | u' == 0 = 3 * u %o A006368 | otherwise = 3 * v + (v' + 1) `div` 2 %o A006368 where (u,u') = divMod n 2; (v,v') = divMod n 4 %o A006368 -- _Reinhard Zumkeller_, Apr 18 2012 %o A006368 (Python) %o A006368 def a(n): return 0 if n == 0 else 3*n//2 if n%2 == 0 else (3*n+1)//4 %o A006368 print([a(n) for n in range(72)]) # _Michael S. Branicky_, Aug 12 2021 %o A006368 (Magma) [n mod 2 eq 1 select Round(3*n/4) else 3*n/2: n in [0..80]]; // _G. C. Greubel_, Jan 03 2024 %Y A006368 Inverse mapping to A006369. %Y A006368 Cf. A047529, A178414, A178415, A265667. %Y A006368 Cf. A028393, A028294, A028397, A180853, A180864, A182205, A217218. %Y A006368 Trajectories under A006368 and A006369: A180853, A217218, A185590, A180864, A028393, A028394, A094328, A094329, A028396, A028395, A217729, A182205, A223083-A223088, A185589, A185590. %K A006368 nonn,nice,easy %O A006368 0,3 %A A006368 _N. J. A. Sloane_ and _J. H. Conway_ %E A006368 Edited by _Michael Somos_, Jul 23 2002 %E A006368 I replaced the definition with the original definition of Conway and Guy. - _N. J. A. Sloane_, Oct 03 2012