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.

A224399 Numbers k such that A224166(k) = A008908(k).

This page as a plain text file.
%I A224399 #4 Apr 06 2013 15:13:31
%S A224399 1,2,4,8,13,16,26,32,35,52,64,70,81,93,104,128,140,162,181,186,208,
%T A224399 241,256,280,324,362,372,416,455,482,483,512,543,560,607,643,645,648,
%U A224399 724,744,809,815,832,903,910,914,915,964,966,967,1024,1079,1081,1086,1087
%N A224399 Numbers k such that A224166(k) = A008908(k).
%C A224399 Numbers k for which the number of iterations starting with -k to reach the last number of the cycle equals the number of iterations starting with k to reach 1 in Collatz (3x+1) trajectory of +/-k.
%e A224399 a(6) = 26 because A224166(26) = A008908(26) = 11.
%e A224399 The trajectory of - 26 is :
%e A224399 -26 -> - 13 -> -38 -> -19 -> -56 -> -28 -> -14 -> -7 -> -20 -> -10 -> -5 with 11 iterations (the first value is counted);
%e A224399 The trajectory of 26 is :
%e A224399 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with 11 iterations (the first value is counted).
%p A224399 z:={1}:
%p A224399   for m from -1 by -1 to -1500 do:
%p A224399    lst:={m}:a:=0: x:=m: lst:=lst union {x}:
%p A224399         for i from 1 to 100 do:
%p A224399          lst:=lst union {x}:
%p A224399          if irem(abs(x), 2)=1
%p A224399          then
%p A224399          x:=3*x+1: lst:=lst union {x}:
%p A224399          else
%p A224399          x:=x/2: lst:=lst union {x}:
%p A224399          fi:
%p A224399          od:
%p A224399          n0:=nops(lst):
%p A224399          if lst intersect z = {1}
%p A224399          then
%p A224399          n1:=n0-2:
%p A224399          else
%p A224399          n1:=n0-1:
%p A224399       fi:
%p A224399        a:=0:y:=-m:
%p A224399           for it from 1 to 100 while (y>1) do:
%p A224399              if irem(y,2)=0
%p A224399              then
%p A224399              y := y/2:a:=a+1:
%p A224399              else
%p A224399               y := 3*y+1: a := a+1:
%p A224399              fi:
%p A224399           od:
%p A224399           if n1=a
%p A224399           then
%p A224399           printf(`%d, `,-m):
%p A224399           else
%p A224399           fi:
%p A224399 od:
%Y A224399 Cf. A008908, A224166.
%K A224399 nonn
%O A224399 1,2
%A A224399 _Michel Lagneau_, Apr 05 2013