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.

A318759 Numbers x whose trajectory reaches 1 under recursive applications of the map x -> x/3 if x == 0 (mod 3), x -> (4*x+2)/3 if x == 1 (mod 3), x -> (4*x+1)/3 if x == 2 (mod 3).

This page as a plain text file.
%I A318759 #23 Oct 12 2018 21:07:17
%S A318759 1,2,3,4,6,9,12,13,18,20,27,29,36,39,40,54,60,65,81,87,108,109,117,
%T A318759 120,121,136,146,162,180,182,195,197,243,245,261,263,272,324,327,328,
%U A318759 332,351,360,363
%N A318759 Numbers x whose trajectory reaches 1 under recursive applications of the map x -> x/3 if x == 0 (mod 3), x -> (4*x+2)/3 if x == 1 (mod 3), x -> (4*x+1)/3 if x == 2 (mod 3).
%o A318759 (C++)
%o A318759 #include <iostream>
%o A318759 using namespace std;
%o A318759 void Number_Generator();
%o A318759 int main()
%o A318759 {
%o A318759     Number_Generator();
%o A318759     return 0;
%o A318759 }
%o A318759 void Number_Generator()
%o A318759 {
%o A318759     int Number_Tested=1; int Temporary;
%o A318759     int Divideby=3;
%o A318759     //For numbers bigger than this you need to use unsigned long int or do some large number implementation.
%o A318759     int Limit=38000;
%o A318759     while(Number_Tested<Limit)
%o A318759     {
%o A318759         Temporary=Number_Tested;
%o A318759         //There are two cycles. 1 and 7 are the smallest numbers in those cycles.
%o A318759         while((Temporary!=1) && (Temporary!=7))
%o A318759         {
%o A318759             if(Temporary%Divideby)
%o A318759                 Temporary=(Temporary*(Divideby+1)+(Divideby-(Temporary%Divideby)))/Divideby;
%o A318759             else
%o A318759                 Temporary=Temporary/Divideby;
%o A318759         }
%o A318759         if(Temporary==1)
%o A318759             cout<<Number_Tested<<"\n";
%o A318759         Number_Tested++;
%o A318759     }
%o A318759 }
%Y A318759 Cf. A014682, A126241, A138754.
%K A318759 nonn
%O A318759 1,2
%A A318759 _Jack Warren_, Sep 02 2018