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!)
A258822 Number of times that k iterations of n under the '3x+1' map yield k for some k. 3
0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,24
COMMENTS
This sequence uses the definition in A006370: if n is odd, n -> 3*n+1, if n is even, n -> n/2.
The number 3 appears first at a(63105). Do all nonnegative numbers appear? See A258824.
LINKS
EXAMPLE
For n = 6, the '3x+1' map is as follows: 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. Here the number of iterations is 8. However, after the k-th iteration, the result does not equal k. Thus a(6) = 0.
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. Only after 10 iterations do we arrive at 10. Since this is the only time this happens, a(7) = 1.
MATHEMATICA
A258822[n_]:=Count[MapIndexed[{#1}==#2-1&, NestWhileList[If[OddQ[#], 3#+1, #/2]&, n, #>1&]], True]; Array[A258822, 100] (* Paolo Xausa, Nov 06 2023 *)
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
for(n=1, 200, d=Tvect(n); c=0; for(i=1, #d, if(d[i]==i-1, c++)); print1(c, ", "))
CROSSREFS
Sequence in context: A127282 A138954 A245811 * A353373 A064530 A307832
KEYWORD
nonn
AUTHOR
Derek Orr, Jun 11 2015
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 March 29 08:53 EDT 2024. Contains 371268 sequences. (Running on oeis4.)