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-3 of 3 results.

A258821 Least number k such that A258772(k) = n.

Original entry on oeis.org

2, 1, 12, 187561
Offset: 0

Views

Author

Derek Orr, Jun 11 2015

Keywords

Comments

If a(n) exists, a(n) > 10^6 for n > 3.
Excluding k = 12, for n = 2, the two fixed points in the trajectory of k occur at 29 and 34 in the section [... 58, 29, 88, 44, 22, 11, 34, 17, 52 ...]. Excluding k = 12, it appears all of the trajectories of the possible k values have length 47 or 48.
For n = 3, the three fixed points occur at position 215, 233, and 251 of the trajectory. It appears all of the trajectories of the possible k values have length 316.

Examples

			T(12) = [12, 6, 3, 10, 5, 16, 8, 4, 2, 1]. The numbers 3 and 5 are in the 3rd and 5th position, respectively. Since 12 is the smallest number to have exactly two fixed points, a(2) = 12. Note that the length of this trajectory is 10. For all other trajectories with exactly 2 fixed points, the length is either 47 or 48.
		

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, c++)); if(c==n, print1(m,", "); m=0; n++); m++)

A258822 Number of times that k iterations of n under the '3x+1' map yield k for some k.

Original entry on oeis.org

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
Offset: 1

Views

Author

Derek Orr, Jun 11 2015

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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, ", "))

A258251 Numbers n for which there exists a fixed point in the Collatz (3x+1) trajectory of n.

Original entry on oeis.org

1, 4, 5, 9, 12, 13, 22, 23, 24, 26, 32, 33, 36, 37, 38, 49, 50, 51, 56, 58, 60, 61, 72, 74, 78, 79, 80, 86, 87, 105, 123, 124, 125, 126, 127, 130, 131, 132, 133, 134, 136, 138, 140, 141, 153, 156, 157, 158, 160, 168, 170, 192, 196, 197, 198, 200, 202, 204, 205, 206, 207, 217, 224, 232, 233, 234, 241, 246, 247, 249
Offset: 1

Views

Author

Derek Orr, Jun 11 2015

Keywords

Comments

Numbers n such that A258772(n) > 0.

Examples

			For n = 5, the trajectory is T(5) = [5, 16, 8, 4, 2, 1]. Since the fourth term in this sequence is 4, 5 has a fixed point. So 5 is a member of this sequence.
For n = 6, the trajectory is T(6) = [6, 3, 10, 5, 16, 8, 4, 2, 1]. Here, there is no fixed point and so, 6 is not a member of this sequence.
		

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