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.

A185452 Image of n under the map n -> n/2 if n even, (5*n+1)/2 if n odd.

This page as a plain text file.
%I A185452 #38 Mar 16 2023 11:25:46
%S A185452 0,3,1,8,2,13,3,18,4,23,5,28,6,33,7,38,8,43,9,48,10,53,11,58,12,63,13,
%T A185452 68,14,73,15,78,16,83,17,88,18,93,19,98,20,103,21,108,22,113,23,118,
%U A185452 24,123,25,128,26,133,27,138,28,143,29,148,30,153,31,158,32,163,33,168,34,173,35,178,36,183,37,188,38,193,39,198
%N A185452 Image of n under the map n -> n/2 if n even, (5*n+1)/2 if n odd.
%D A185452 J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see pages 11, 88.
%H A185452 Vincenzo Librandi, <a href="/A185452/b185452.txt">Table of n, a(n) for n = 0..10000</a>
%H A185452 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%H A185452 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F A185452 a(n) = (6*n+1-(4*n+1)*(-1)^n)/4; g.f.: x*(3+x+2*x^2)/(1-x^2)^2; a(n) = 2*a(n-2)-a(n-4) for n>3. [_Bruno Berselli_, Feb 09 2011]
%p A185452 f:=n->if n mod 2 = 0 then n/2 else (5*n+1)/2; fi;
%t A185452 LinearRecurrence[{0,2,0,-1},{0,3,1,8},80] (* _Harvey P. Dale_, May 16 2014 *)
%t A185452 If[EvenQ[#],#/2,(5#+1)/2]&/@Range[0,80] (* _Harvey P. Dale_, Jan 02 2015 *)
%o A185452 (Magma) [ IsEven(n) select n/2 else (5*n+1)/2: n in [0..79] ]; // _Bruno Berselli_, Feb 09 2011
%o A185452 (PARI) a(n)=if(n%2,5*n+1,n)/2 \\ _Charles R Greathouse IV_, Sep 02 2015
%Y A185452 Cf. A185453, A185454, A185455.
%K A185452 nonn,easy
%O A185452 0,2
%A A185452 _N. J. A. Sloane_, Feb 04 2011