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.

A281938 a(n) is the least k such that gcd(A006666(k), A006667(k)) = n.

This page as a plain text file.
%I A281938 #10 Sep 16 2017 00:29:50
%S A281938 2,4,8,16,32,64,128,256,512,82,129,4096,327,16384,32768,1249,35655,
%T A281938 159,4926,283,377,502,603,799,1063,1417,1889,2518,3356,4472,5960,7944,
%U A281938 10594,14124,18833,25110,33481,44641,59521,79361,105814,141084,188113,250817,334422
%N A281938 a(n) is the least k such that gcd(A006666(k), A006667(k)) = n.
%C A281938 A006666: Number of halving steps to reach 1 in '3x+1' problem.
%C A281938 A006667: number of tripling steps to reach 1 in '3x+1' problem.
%C A281938 a(n) = 2^n for n = 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15.
%C A281938 The primes in the sequence are 2, 283, 1063, 1249, 1889, 44641, ...
%H A281938 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A281938 a(10) = 82 because gcd(A006666(82), A006667(82)) = gcd(70, 40) = 10, and there is no k < 82 such that gcd(A006666(k), A006667(k)) = 10.
%p A281938 for n from 1 to 45 do:
%p A281938 ii:=0:
%p A281938 for k from 2 to 10^7 while(ii=0) do:
%p A281938   m:=k:s1:=0:s2:=0:
%p A281938    for i from 1 to nn while(m<>1) do:
%p A281938     if irem(m,2)=0
%p A281938      then
%p A281938      s2:=s2+1:m:=m/2:
%p A281938      else
%p A281938      s1:=s1+1:m:=3*m+1:
%p A281938     fi:
%p A281938    od:
%p A281938     if gcd(s1,s2)=n
%p A281938      then
%p A281938      ii:=1:printf(`%d %d \n`,n,k):
%p A281938      else
%p A281938     fi:
%p A281938 od:
%p A281938 od:
%t A281938 Function[w, First /@ Lookup[w, Function[k, If[k == {}, #, Take[#, First@ k]]]@ Complement[Range@ Max@ #, #]] &@ Keys@ w]@ KeySort@ PositionIndex@ Table[GCD[Count[NestWhileList[If[OddQ[#], 3 # + 1, #/2] &, n, # > 1 &], _?(EvenQ[#] &)], Count[Differences[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]], _?Positive]], {n, 2^16}] (* _Michael De Vlieger_, Feb 02 2017, Version 10, after _Harvey P. Dale_ at A006666 and A006667 *)
%Y A281938 Cf. A006577, A006666, A006667.
%K A281938 nonn
%O A281938 1,1
%A A281938 _Michel Lagneau_, Feb 02 2017