The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 0
1, 2, 3, 4, 6, 9, 12, 13, 18, 20, 27, 29, 36, 39, 40, 54, 60, 65, 81, 87, 108, 109, 117, 120, 121, 136, 146, 162, 180, 182, 195, 197, 243, 245, 261, 263, 272, 324, 327, 328, 332, 351, 360, 363 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
PROG
(C++)
#include <iostream>
using namespace std;
void Number_Generator();
int main()
{
Number_Generator();
return 0;
}
void Number_Generator()
{
int Number_Tested=1; int Temporary;
int Divideby=3;
//For numbers bigger than this you need to use unsigned long int or do some large number implementation.
int Limit=38000;
while(Number_Tested<Limit)
{
Temporary=Number_Tested;
//There are two cycles. 1 and 7 are the smallest numbers in those cycles.
while((Temporary!=1) && (Temporary!=7))
{
if(Temporary%Divideby)
Temporary=(Temporary*(Divideby+1)+(Divideby-(Temporary%Divideby)))/Divideby;
else
Temporary=Temporary/Divideby;
}
if(Temporary==1)
cout<<Number_Tested<<"\n";
Number_Tested++;
}
}
CROSSREFS
Sequence in context: A288734 A332034 A332035 * A018471 A240307 A128166
KEYWORD
nonn
AUTHOR
Jack Warren, Sep 02 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 25 14:05 EDT 2024. Contains 372788 sequences. (Running on oeis4.)