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.

Previous Showing 21-29 of 29 results.

A353265 Partial sums of A208981.

Original entry on oeis.org

0, 0, 3, 3, 4, 8, 20, 20, 35, 37, 47, 52, 57, 70, 83, 83, 91, 107, 123, 126, 127, 138, 149, 155, 174, 180, 287, 301, 315, 329, 431, 431, 453, 462, 471, 488, 505, 522, 552, 556, 661, 663, 688, 700, 712, 724, 824, 831, 851, 871, 891, 898, 905, 1013, 1121, 1136, 1164, 1179, 1207, 1222, 1237, 1340, 1443, 1443
Offset: 1

Views

Author

Omar E. Pol, Apr 09 2022

Keywords

Crossrefs

Cf. A208981, A347270 (gives all 3x+1 sequences).

Programs

  • Mathematica
    Accumulate @ Table[-1 + Length @ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, ! IntegerQ @ Log[2, #] &], {n, 1, 64}] (* Amiram Eldar, Apr 09 2022 *)
  • PARI
    ispow2(n)=n>>=valuation(n, 2); n==1;
    f(n) = my(s); while(!ispow2(n), n=if(n%2, 3*n+1, n/2); s++); s; \\ A208981
    a(n) = sum(i=1, n, f(i)); \\ Michel Marcus, Apr 13 2022

A125686 Where records occur in A127885.

Original entry on oeis.org

1, 2, 3, 6, 7, 14, 19, 25, 31, 62, 107, 127, 255, 339, 479, 639, 799
Offset: 1

Views

Author

David Applegate and N. J. A. Sloane, Feb 06 2007

Keywords

Crossrefs

A375094 a(n) is the least number not occurring in a Collatz trajectory of n steps.

Original entry on oeis.org

2, 3, 3, 3, 3, 3, 3, 6, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 18, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27
Offset: 0

Views

Author

Markus Sigg and Hugo Pfoertner, Aug 03 2024

Keywords

Comments

A006877 and A288493 form a run-length encoding of this sequence: It starts with A288493(1) copies of A006877(2), followed by A288493(2) copies of A006877(3), followed by A288493(3) copies of A006877(4), and so on.

Examples

			a(5) = 3 because there are two trajectories with 5 steps, namely (32,16,8,4,2,1) and (5,16,8,4,2,1). 3 is the smallest number not appearing in both.
		

Crossrefs

Programs

  • Python
    # output in b-file format
    from itertools import count
    n = 0
    for k in count():
        m = k
        s = 0
        while m > 1:
            m = m // 2 if m % 2 == 0 else 3*m+1
            s += 1
        while n < s:
            print(n, k, flush=True)
            n += 1

A380138 a(n) is the largest value in the '3x+1' trajectory of starting points producing a record number of steps.

Original entry on oeis.org

1, 2, 16, 16, 52, 52, 52, 88, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 250504, 190996, 190996, 250504, 250504, 250504, 481624, 975400, 975400, 497176, 11003416, 11003416, 106358020, 18976192, 41163712, 106358020, 21933016, 104674192, 593279152
Offset: 1

Views

Author

Hugo Pfoertner, Jan 13 2025

Keywords

Crossrefs

Programs

  • Mathematica
    s = Map[ToExpression,
      StringSplit[
        Import["https://oeis.org/A006877/b006877.txt", "Data"][[2 ;; -1]]
      ][[All, -1]] ];
    Map[Max@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, #, # > 1 &] &, s] (* Michael De Vlieger, Jan 13 2025 *)

Formula

a(n) = A025586(A006877(n)).

A276665 In the '3x+1' problem, these values for the starting value set new records for both the number of steps and the highest point of trajectory before reaching 1.

Original entry on oeis.org

1, 2, 3, 7, 27, 703, 26623
Offset: 1

Views

Author

Keywords

Comments

Both the 3x+1 steps and the halving steps are counted.
If it exists, a(7) > 14727207461063895711 (A006877(148)). - Hugo Pfoertner, Jan 12 2025

Crossrefs

Intersection of A006877 and A006884.

A375093 Numbers for which the number of squares in their Collatz trajectory sets a new record.

Original entry on oeis.org

1, 3, 9, 27, 133, 315, 747, 2799, 14175, 287061, 530079, 3061987, 18371925, 73487701, 195967203, 1175803221
Offset: 1

Views

Author

Hugo Pfoertner, Jul 29 2024

Keywords

Examples

			a(1) = 1: the square 1 contained in every trajectory at the end,
a(2) = 3: 3 squares in 3 -> 10 -> 5 -> 4^2 -> 8 -> 2^2 -> 2 -> 1^2,
a(3) = 9: 4 squares in 3^2 -> 28 -> ... -> 10 -> as above,
a(4) = 27: the famous long trajectory A008884 includes the 5 squares 22^2, 11^2, 4^2, 2^2, 1^2,
a(5) = 133: 6 squares in 133 -> 20^2 -> 200 -> 10^2 -> 50 -> 5^2 -> ... -> 4^2, 2^2, 1^2,
a(6) = 315: 7 squares in 315 -> 946 -> ... -> 533 -> 40^2 -> 800 -> 20^2 -> as above,
a(7) = 747: 9 squares in 747 -> 2242 -> 1121 -> 58^2 -> 1682 -> 29^2 -> ... -> 1066 -> 533 -> as above.
		

Crossrefs

Programs

  • PARI
    nextc(x) = if (x%2==0, x\2, 3*x+1);
    a375093(upto=600000) = {my(m=0); for (k=1, upto, np=issquare(k); j=k; while (j>1, j=nextc(j); if (issquare(j), np++)); if (np>m, m=np; print1(k,", ")))}

A143812 Maximal number of halving and tripling steps to reach 1 in '3x+1' problem for range (1, ..., n).

Original entry on oeis.org

1, 2, 8, 8, 8, 9, 17, 17, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 24, 24, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113
Offset: 1

Views

Author

Benjamin Frost (benjamin.frost(AT)students.adelaide.edu.au), Sep 02 2008

Keywords

Crossrefs

Programs

  • Mathematica
    nst[n_]:=Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]]; nn=60; With[ {stps= Array[nst,nn]},Table[Max[Take[stps,n]],{n,nn}]]  (* Harvey P. Dale, Apr 17 2014 *)

Extensions

Corrected and extended by Harvey P. Dale, Apr 17 2014

A284668 Numbers that have the largest Collatz total stopping time of all numbers below 10^n. The smallest number is chosen in case of ties.

Original entry on oeis.org

9, 97, 871, 6171, 77031, 837799, 8400511, 63728127, 670617279, 9780657630, 75128138247, 989345275647, 7887663552367, 80867137596217, 942488749153153, 7579309213675935, 93571393692802302, 931386509544713451
Offset: 1

Views

Author

Rahul Chand, Apr 01 2017

Keywords

Comments

Collatz stopping time is defined as the number of steps that a number n takes to converge to 1 using one of the following steps:
0) if n is 1, stop.
1) if n is even, divide n by 2 (n/2).
2) if n is odd, multiply n by 3 and add 1 (3n+1).
Subsequence of A006877. The first tie occurs at a(10) which is tied with 9780657631. - Jens Kruse Andersen, Feb 23 2021

Examples

			For n=1, steps(1) to steps(9) take the following values: 0, 1, 7, 2, 5, 8, 16, 3, 19; the maximum of all those is 19 which occurs for steps(9) therefore a(1)=9.
		

Crossrefs

Programs

  • Mathematica
    Table[Last@Ordering@Array[If[#>1,#0@If[OddQ@#,3#+1,#/2]+1,0]&,10^k],{k,4}] (* Giorgos Kalogeropoulos, Apr 01 2021 *)
  • Python
    def steps(n):
        if n==1:
            return 0
        else:
            if (n%2)==0:
                return 1+steps(n//2)
            else:
                return 1+steps(3*n+1)
    def max_steps(i):
        a=max([[i, steps(i)] for i in range(1, 10**(i))], key=lambda x:x[1])
        return a[0]

Formula

a(n) = max{i} (steps(i) for i in range from 1 to 10^n-1).
max(i) returns the i with the maximum steps(i) value.
where steps(n) is defined as follows
steps(n)= 0 if n=1.
1+steps(n/2) if n is even.
1+steps(3*n+1) if n is odd.

Extensions

Clarified and extended by Jens Kruse Andersen, Feb 23 2021

A339614 Inputs n that yield a record-breaking value of A008908(n)/(log_2(n)+1) for the Collatz conjecture.

Original entry on oeis.org

1, 3, 7, 9, 27, 26623, 35655, 52527, 142587, 156159, 230631, 626331, 837799, 1723519, 3542887, 3732423, 5649499, 6649279, 8400511, 63728127, 3743559068799, 100759293214567, 104899295810901231
Offset: 1

Views

Author

Matthew Russell Downey, Dec 10 2020

Keywords

Comments

The metric A008908(n)/(log_2(n)+1) is always equal to 1 for any power of 2 (where 1 is the smallest possible value).

Examples

			a(1) = 1, which is trivial, because the first element in any sequence is record setting.
a(5) = 27, because A008908(n)/(log_2(n)+1) yields a maximum value at n=27 among the first 27 elements, and there are 4 record-breaking elements beforehand.
		

Crossrefs

Programs

  • Python
    import math
    oeis_A006877 = [1, 2, 3, 6, 7, 9, 18, 25, 27, 54, 73, 97, 129, 171, 231, 313, 327, 649, 703, 871, 1161, 2223, 2463, 2919, 3711, 6171, 10971, 13255, 17647, 23529, 26623, 34239, 35655, 52527, 77031, 10623, 142587, 156159, 216367, 230631, 410011, 511935, 626331, 837799, 1117065, 1501353, 1723519, 2298025, 3064033, 3542887, 3732423, 5649499, 6649279, 8400511, 11200681, 14934241, 15733191, 31466382, 36791535, 63728127]
    def stopping_time(n):
        time = 1
        while n>1:
            n = 3*n + 1 if n & 1 else n//2
            time += 1
        return time
    def stopping_time_metric(n):
        time = stopping_time(n)
        logarithmic_distance = (math.log(n, 2)+1)
        return float(time/logarithmic_distance)
    result = []
    record_input = oeis_A006877[0]
    record_stopping_time_metric = stopping_time_metric(record_input)
    result.append(record_input)
    for n in range(1, len(oeis_A006877)):
        current_input = oeis_A006877[n]
        current_stopping_time_metric = stopping_time_metric(current_input)
        if current_stopping_time_metric > record_stopping_time_metric:
            record_input = current_input
            record_stopping_time_metric = current_stopping_time_metric
            result.append(record_input)
    for n in range(len(result)):
        print(result[n], end=", ")
Previous Showing 21-29 of 29 results.