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.

Showing 1-2 of 2 results.

A258824 Least number k such that A258822(k) = n.

Original entry on oeis.org

1, 2, 24, 63105
Offset: 0

Views

Author

Derek Orr, Jun 11 2015

Keywords

Comments

If a(n) exists, a(n) > 10^6 for n > 3.
Excluding k = 24, for n = 2, after 29 and 34 iterations, you arrive at 29 and 34, respectively. Excluding k = 24, it appears all of the trajectories of the possible k values have length 48 or 49.
For n = 3, after 216, 234, and 252 iterations, you arrive at 216, 234, and 252, respectively. It appears all of the trajectories of the possible k values have length 317.

Examples

			For n = 24, the '3x+1' map is as follows: 24 -> 12 -> 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. After the 3rd iteration, we reach 3 and after the 5 iteration, we reach 5. Since 12 is the smallest number to have exactly two occurrences, a(2) = 24. Note that the length of this trajectory is 11. For all other trajectories with exactly two occurrences, the length is either 48 or 49.
		

Crossrefs

Programs

  • 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=0; m=1; while(m<10^3, d=Tvect(m); c=0; for(i=1, #d, if(d[i]==i-1, c++)); if(c==n, print1(m, ", "); m=0; n++); m++)

A258823 Numbers m such that k iterations of m under the '3x+1' map yield k for some k.

Original entry on oeis.org

2, 7, 8, 10, 18, 19, 24, 26, 41, 43, 44, 45, 46, 48, 52, 53, 64, 65, 66, 67, 72, 74, 76, 77, 97, 98, 99, 100, 101, 102, 112, 116, 117, 120, 122, 144, 148, 149, 153, 156, 157, 158, 160, 172, 173, 174, 175, 209, 210, 211, 246, 247, 248, 249, 250, 252, 253, 254, 255, 260, 261, 262, 264, 266, 268, 269, 272
Offset: 1

Views

Author

Derek Orr, Jun 11 2015

Keywords

Comments

Numbers m such that A258822(m) > 0.

Examples

			For m = 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 m = 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.
		

Crossrefs

Programs

  • 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 *)
  • 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++)
Showing 1-2 of 2 results.