The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A275663 Number of squares in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function. 1
 1, 1, 3, 2, 3, 3, 3, 2, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 4, 3, 5, 3, 3, 3, 5, 3, 5, 3, 3, 5, 3, 3, 3, 3, 5, 4, 5, 3, 3, 3, 5, 3, 4, 4, 3, 3, 3, 5, 5, 3, 5, 3, 3, 3, 3, 5, 3, 4, 5, 5, 3, 3, 3, 3, 5, 5, 5, 3, 5, 3, 3, 3, 3, 3, 4, 5, 5, 4, 5, 5, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS Or number of squares in the trajectory of n under the 3x+1 map (i.e. the number of squares until the trajectory reaches 1). LINKS Table of n, a(n) for n=1..87. EXAMPLE The finite sequence n, f(n), f(f(n)), ...., 1 for n = 12 is: 12, 6, 3, 10, 5, 16, 8, 4, 2, 1, which has three square terms. Hence a(12) = 3. MATHEMATICA Reap[For[n=1, n <= 100, n++, s=n; t=1; While[s != 1, If[IntegerQ[Sqrt[s]], t++]; If[EvenQ[s], s=s/2, s=3*s+1]]; If[s == 1, Sow[t]]]][[2, 1]] (* Jean-François Alcover, Nov 17 2016, adapted from PARI *) PROG (PARI) print1(1, ", "); for(n=2, 100, s=n; t=1; while(s!=1, if(issquare(s), t++, t=t); if(s%2==0, s=s/2, s=(3*s+1)); if(s==1, print1(t, ", "); ); )) CROSSREFS Cf. A006577. Sequence in context: A230258 A016459 A242309 * A369100 A060585 A114451 Adjacent sequences: A275660 A275661 A275662 * A275664 A275665 A275666 KEYWORD nonn AUTHOR Michel Lagneau, Aug 04 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.

Last modified May 21 21:53 EDT 2024. Contains 372738 sequences. (Running on oeis4.)