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.

This page as a plain text file.
%I A282408 #16 Sep 04 2018 17:39:34
%S A282408 1,2,16,17,322,323,512,1595,1598,1599,1609,1614,1615,1627,1641,1643,
%T A282408 1657,1663,1776,1780,1781,1784,1786,2176,2208,2216,2218,2240,2256,
%U A282408 2260,2261,2274,2275,2400,2408,2410,2416,2417,2420,2421,3844,3845,3846,3848,3850,3852
%N 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.
%C A282408 Or numbers m such that A078719(m) and A006666(m) are both a perfect square.
%C A282408 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).
%C A282408 The numbers 2^(m^2) = A002416(m) are in the sequence, and the corresponding pairs of squares are (1, m^2).
%C A282408 Number of terms <= 10^h: 2, 4, 7, 202, 203, 474, 20888, etc. _Robert G. Wilson v_, Feb 14 2017
%H A282408 Robert G. Wilson v, <a href="/A282408/b282408.txt">Table of n, a(n) for n = 1..10000</a>
%H A282408 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A282408 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.
%p A282408 nn:=10^6:
%p A282408 for n from 1 to 10000 do:
%p A282408   m:=n:i1:=1:i2:=0:
%p A282408    for i from 1 to nn while(m<>1) do:
%p A282408     if irem(m,2)=0
%p A282408      then
%p A282408      m:=m/2:i2:=i2+1:
%p A282408      else
%p A282408      m:=3*m+1:i1:=i1+1:
%p A282408     fi:
%p A282408    od:
%p A282408     if sqrt(i1)=floor(sqrt(i1)) and sqrt(i2)=floor(sqrt(i2))
%p A282408      then
%p A282408      printf(`%d, `,n):
%p A282408      else
%p A282408     fi:
%p A282408 od:
%t A282408 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 *)
%t A282408 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 *)
%Y A282408 Cf. A000079, A002416, A078719, A006666, A006667.
%K A282408 nonn
%O A282408 1,2
%A A282408 _Michel Lagneau_, Feb 14 2017