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.

A056959 In repeated iterations of function m -> m/2 if m even, m -> 3m+1 if m odd, a(n) is maximum value achieved if starting from n.

Original entry on oeis.org

4, 4, 16, 4, 16, 16, 52, 8, 52, 16, 52, 16, 40, 52, 160, 16, 52, 52, 88, 20, 64, 52, 160, 24, 88, 40, 9232, 52, 88, 160, 9232, 32, 100, 52, 160, 52, 112, 88, 304, 40, 9232, 64, 196, 52, 136, 160, 9232, 48, 148, 88, 232, 52, 160, 9232, 9232, 56, 196, 88, 304, 160, 184
Offset: 1

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If a(n) exists (which is the essence of the "3x+1" problem) then a(n) must be a multiple of 4, since if a(n) was odd then the next iteration 3*a(n)+1 would be greater than a(n), while if a(n) was twice an odd number then the next-but-one iteration (3/2)*a(n)+1 would be greater.
The variant A025586 considers the trajectory ending in 1, by definition. Therefore the two sequences differ just at a(1) and a(2). - M. F. Hasler, Oct 20 2019

Examples

			a(6) = 16 since iteration starts: 6, 3, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, ... and 16 is highest value.
		

Crossrefs

Essentially the same as A025586.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 4,
          max(n, a(`if`(n::even, n/2, 3*n+1))))
        end:
    seq(a(n), n=1..88);  # Alois P. Heinz, Oct 16 2021
  • Mathematica
    a[n_] := Module[{r = n, m = n}, If[n <= 2, 4, While[m > 2, If[OddQ[m], m = 3*m + 1; If[m > r, r = m], m = m/2]]; r]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 20 2022 *)
  • PARI
    a(n)=my(r=max(4,n));while(n>2,if(n%2,n=3*n+1;if(n>r,r=n),n/=2));r \\ Charles R Greathouse IV, Jul 19 2011

A056997 Number of days in months of Ethiopic calendar.

Original entry on oeis.org

30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 5, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 5, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 5, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 6
Offset: 1

Views

Author

Robert G. Wilson v, Sep 06 2000

Keywords

Comments

The twelve months of Maskaram, Tepemt, Khedar, Takhsas, Ter, Yakatit, Magabit, Miyazya, Genbot, Sane, Harnle and Nahase each have thirty days and the remaining days are in Paguemen.
The intercalary month has 5 days on non-leap years, 6 days on leap years. Every fourth year is a leap year, with no exceptions. Thus, a(n) = a(n-52). - Jon E. Schoenfield, Feb 16 2015

Crossrefs

Cf. A056958.

Extensions

As Antti Karttunen points out, this cannot be right as there are 15 or 16 30's between pairs of 5's, not 11. - N. J. A. Sloane, Aug 25 2002
Marked one link as broken. Added two links and cf. to the Coptic Calendar. - R. J. Mathar, Oct 13 2008
Showing 1-2 of 2 results.