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!)
A277367 a(n) = gcd(A006666(n), A006667(n)) where A006666 and A006667 are respectively the number of halving and tripling steps in the '3x+1' problem. 1
0, 1, 1, 2, 1, 2, 1, 3, 1, 1, 2, 1, 1, 1, 1, 4, 3, 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 5, 2, 1, 1, 3, 3, 3, 1, 1, 1, 1, 1, 4, 4, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 1, 2, 10, 10, 1, 1, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
FORMULA
a(2^m) = m.
EXAMPLE
a(17) = 3 because gcd(A006666(17), A006667(17)) = gcd(9, 3) = 3.
MAPLE
nn:=100:
for n from 1 to nn do:
m:=n:it0:=0:it1:=0:
for j from 1 to 1000 while(m<>1) do:
if irem(m, 2)=0
then
m:=m/2:it0:=it0+1:
else
m:=3*m+1:it1:=it1+1:
fi:
od:
q:=gcd(it0, it1):printf(`%d, `, q):
od:
MATHEMATICA
Table[GCD[Count[NestWhileList[If[OddQ@ #, 3 # + 1, #/2] &, n, # > 1 &], _?EvenQ], Count[Differences[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # > 1 &]], _?Positive]], {n, 87}] (* Michael De Vlieger, Oct 13 2016, after Harvey P. Dale at A006666 and A006667 *)
PROG
(PARI) a(n) = {my(se = 0); my(so = 0); while (n!=1, if (n % 2, so++; n = 3*n+1, se++; n = n/2); ); gcd(se, so); } \\ Michel Marcus, Oct 13 2016
CROSSREFS
Sequence in context: A324286 A265575 A352177 * A239936 A239701 A303755
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 11 2016
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 July 17 02:40 EDT 2024. Contains 374360 sequences. (Running on oeis4.)