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.

A274410 Numbers n such that the Collatz iterations for n and n + 1 have the same length (A078417) but do not meet a certain condition. (See comments.)

Original entry on oeis.org

3067, 4088, 4089, 5742, 6135, 7151, 8179, 8263, 8614, 9979, 10904, 10905, 11016, 11017, 11485, 12922, 13304, 13305, 14303, 14538, 14539, 14689, 15303, 15313, 16527, 16891, 17229, 19384, 19385, 19386, 19585, 19959, 20417, 21482, 21791, 21808, 21811, 22035
Offset: 1

Views

Author

Eric M. Schmidt, Jun 21 2016

Keywords

Comments

Consider the parity vectors of the Collatz iterations of n and n + 1. Consider the portions of the vectors before the Collatz iterations start to coincide. Then the condition to exclude n from the sequence is that these portions end in (0, 0, 1) and (1, 0, 0), in either order.

Examples

			The Collatz iterations for 3067 and 3068 yield 1384 on the 27th iteration in both cases. For 3067, the three previous terms are (1844, 922, 461), with parities (0, 0, 1). For 3068, the three previous terms are (11072, 5536, 2768), with parities (0, 0, 0). Thus the condition fails to hold and 3067 is in the sequence.
		

Crossrefs

Programs

  • Sage
    def collatz(n) : return 3*n+1 if n%2 else n//2
    def isa(n) :
        parityn = paritynp1 = [-1]*3
        valn = n
        valnp1 = n+1
        while valn != valnp1 :
            if valn==1 or valnp1==1 : return False
            parityn = [parityn[1], parityn[2], valn%2]
            paritynp1 = [paritynp1[1], paritynp1[2], valnp1%2]
            valn = collatz(valn)
            valnp1 = collatz(valnp1)
        return [parityn, paritynp1] not in [ [[1,0,0],[0,0,1]], [[0,0,1],[1,0,0]] ]

A275968 Smaller of two consecutive primes p and q such that c(p) = c(q), where c(n) = A008908(n) is the length of x, f(x), f(f(x)), ... , 1 in the Collatz conjecture.

Original entry on oeis.org

173, 409, 419, 421, 439, 487, 521, 557, 571, 617, 761, 887, 919, 1009, 1039, 1117, 1153, 1171, 1217, 1327, 1373, 1549, 1559, 1571, 1657, 1693, 1709, 1721, 1733, 1783, 1831, 1861, 1901, 1993, 1997, 2053, 2089, 2339, 2393, 2521, 2539, 2647, 2657, 2677, 2693, 2777
Offset: 1

Views

Author

Abhiram R Devesh, Aug 15 2016

Keywords

Comments

If x is even f(x) = x/2 else f(x) = 3x + 1.

Examples

			a(1) = p = 173; q = 179
c(p) = c(q) = 32
		

Crossrefs

Cf. A006577 (Collatz trajectory lengths), A078417, A008908.

Programs

  • Mathematica
    t = Table[Length@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &] - 1, {n, 10^4}]; Prime@ Flatten@ Position[#, k_ /; Length@ k == 1] &@ Map[Union@ Part[t, #] &, #] &@ Partition[#, 2, 1] &@ Prime@ Range@ 410 (* Michael De Vlieger, Sep 01 2016 *)
  • PARI
    A008908(n)=my(c=1); while(n>1, n=if(n%2, 3*n+1, n/2); c++); c
    t=A008908(p=2); forprime(q=3,1e4, tt=A008908(q); if(t==tt, print1(p", ")); p=q; t=tt) \\ Charles R Greathouse IV, Sep 01 2016
    
  • Python
    import sympy
    def lcs(n):
        a=1
        while n>1:
            if n%2==0:
                n=n//2
            else:
                n=(3*n)+1
            a=a+1
        return(a)
    m=2
    while m>0:
        n=sympy.nextprime(m)
        if lcs(m)==lcs(n):
            print(m,)
        m=n
    # Abhiram R Devesh, Sep 02 2016

A355312 Irregular triangle read by rows, in which the rows list groups of consecutive integers taking the same number of halving and tripling steps to reach 1 in '3X+1' problem. Groups are in order of the number of steps required, and in numerical order among those with the same number of steps.

Original entry on oeis.org

20, 21, 12, 13, 84, 85, 52, 53, 340, 341, 34, 35, 212, 213, 226, 227, 1364, 1365, 68, 69, 70, 452, 453, 454, 22, 23, 140, 141, 150, 151, 852, 853, 908, 909, 5460, 5461, 44, 45, 46, 276, 277, 300, 301, 302, 1812, 1813, 14, 15, 92, 93, 564, 565, 604, 605, 3412, 3413
Offset: 1

Views

Author

Paul Duckett, Jun 27 2022

Keywords

Examples

			20 and 21 are terms since they both use 7 steps (trajectories 20, 10, 5, 16, 8, 4, 2, 1 and 21, 64, 32, 16, 8, 4, 2, 1).
300, 301 and 302 are terms since they all use 16 steps.
The triangle starts:
   7:  20   21
   9:  12   13   84   85
  11:  52   53  340  341
  13:  34   35  212  213  226  227 1364 1365
  14:  68   69   70  452  453  454
  15:  22   23  140  141  150  151  852  853  908  909 5460 5461
  16:  44   45   46  276  277  300  301  302 1812 1813
  17:  14   15   92   93  564  565  604  605 3412 3413
		

Crossrefs

Subtriangle of A127824.

Programs

  • PARI
    See Links section.
Showing 1-3 of 3 results.