OFFSET
1,1
COMMENTS
Numbers n such that A258822(n) > 0.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = 6, the '3x+1' map is as follows: 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. For any possible k, after the k-th iteration, the result does not equal k. Thus 6 is not a member of this sequence.
For n = 7, the '3x+1' map is as follows: 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. After 10 iterations, we arrive at 10. So, 7 is a member of this sequence.
MATHEMATICA
kQ[n_]:=Module[{tr=Rest[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]], len}, len = Length[ tr]; Count[Thread[{tr, Range[len]}], _?(#[[1]] == #[[2]]&)]>0]; Select[Range[300], kQ] (* Harvey P. Dale, Jan 13 2017 *)
PROG
(PARI) Tvect(n)=v=[n]; while(n!=1, if(n%2, k=3*n+1; v=concat(v, k); n=k); if(!(n%2), k=n/2; v=concat(v, k); n=k)); v
n=1; while(n<10^3, d=Tvect(n); c=0; for(i=1, #d, if(d[i]==i-1, print1(n, ", "); break)); n++)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jun 11 2015
STATUS
approved