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.

A271623 a(0)=7; a(n) = 7*a(n-1) + 1 if a(n-1) is odd, a(n) = a(n-1)/2 otherwise.

This page as a plain text file.
%I A271623 #15 Sep 08 2022 08:46:16
%S A271623 7,50,25,176,88,44,22,11,78,39,274,137,960,480,240,120,60,30,15,106,
%T A271623 53,372,186,93,652,326,163,1142,571,3998,1999,13994,6997,48980,24490,
%U A271623 12245,85716,42858,21429,150004,75002,37501,262508,131254,65627,459390,229695
%N A271623 a(0)=7; a(n) = 7*a(n-1) + 1 if a(n-1) is odd, a(n) = a(n-1)/2 otherwise.
%C A271623 Conjectured: No term of the sequence is equal to a previous term.
%e A271623 7 is odd, so it is followed by 7*7 + 1 = 50.
%e A271623 50 is even, so it is followed by 50/2 = 25.
%t A271623 NestList[If[EvenQ[#], #/2, 7 # + 1]&, 7, 60]
%o A271623 (Magma) [n eq 1 select 7 else IsOdd(Self(n-1)) select 7*Self(n-1)+1 else Self(n-1) div 2: n in [1..60]];
%o A271623 (PARI) Collatz(n, lim=0) = {my(c=n, e=0, L=List(n)); if(lim==0, e=1; lim=n*10^2);
%o A271623 for(i=1, lim, if(c%2==0, c=c/2, c=7*c+1); listput(L, c); if(e&&c==1, break)); return(Vec(L));}
%o A271623 print(Collatz(7)) \\ Adapted from A008884 \\ _Altug Alkan_, Apr 11 2016
%Y A271623 Cf. A033478, A259207.
%K A271623 nonn,easy
%O A271623 0,1
%A A271623 _Vincenzo Librandi_, Apr 11 2016