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.

A282408 Numbers k for which the number of odd members and the number of even members in the Collatz (3x+1) trajectory are both a perfect square.

Original entry on oeis.org

1, 2, 16, 17, 322, 323, 512, 1595, 1598, 1599, 1609, 1614, 1615, 1627, 1641, 1643, 1657, 1663, 1776, 1780, 1781, 1784, 1786, 2176, 2208, 2216, 2218, 2240, 2256, 2260, 2261, 2274, 2275, 2400, 2408, 2410, 2416, 2417, 2420, 2421, 3844, 3845, 3846, 3848, 3850, 3852
Offset: 1

Views

Author

Michel Lagneau, Feb 14 2017

Keywords

Comments

Or numbers m such that A078719(m) and A006666(m) are both a perfect square.
For k < 5*10^6, the fourteen distinct pairs of squares in the order of appearance are: (1, 0), (1, 1), (1, 4), (4, 9), (36, 64), (1, 9), (25, 49), (4, 16), (16, 36), (9, 25), (1, 16), (81, 144), (4, 25) and (64, 121).
The numbers 2^(m^2) = A002416(m) are in the sequence, and the corresponding pairs of squares are (1, m^2).
Number of terms <= 10^h: 2, 4, 7, 202, 203, 474, 20888, etc. Robert G. Wilson v, Feb 14 2017

Examples

			17 is in the sequence because the Collatz trajectory is 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 => the number of odd members is 4 = 2^2 and number of even members is 9 = 3^2.
		

Crossrefs

Programs

  • Maple
    nn:=10^6:
    for n from 1 to 10000 do:
      m:=n:i1:=1:i2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         m:=m/2:i2:=i2+1:
         else
         m:=3*m+1:i1:=i1+1:
        fi:
       od:
        if sqrt(i1)=floor(sqrt(i1)) and sqrt(i2)=floor(sqrt(i2))
         then
         printf(`%d, `,n):
         else
        fi:
    od:
  • Mathematica
    fQ[n_] := Block[{m = n, e = 0, o = 1}, While[m > 1, If[OddQ@ m, m = 3 m + 1; o++, m /= 2; e++]]; IntegerQ@ Sqrt@ e && IntegerQ@ Sqrt@ o]; Select[ Range@ 3855, fQ] (* Robert G. Wilson v, Feb 14 2017 *)
    memsqQ[n_]:=Module[{col=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]}, AllTrue[ {Sqrt[ Count[ col, ?(EvenQ[#]&)]],Sqrt[Count[col,?(OddQ[ #]&)]]},IntegerQ]]; Select[Range[4000],memsqQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 04 2018 *)