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 61-70 of 121 results. Next

A347668 Indices of records in A347409.

Original entry on oeis.org

1, 2, 3, 15, 21, 75, 151, 1365, 5461, 7407, 14563, 87381, 184111, 932067, 5592405, 13256071, 26512143, 357913941, 1431655765, 3817748707, 22906492245, 91625968981, 244335917283, 1466015503701, 5212499568715, 10424999137431, 93824992236885
Offset: 1

Views

Author

Paolo Xausa, Sep 10 2021

Keywords

Comments

Conjecture 1: A347409(a(n)) is even for n >= 11. Conjecture 2: all even numbers > 2 appear as A347409(a(n)) for some n. - Chai Wah Wu, Sep 29 2021
If conjectures 1 and 2 are true, then A347409(a(n)) = 2n - 6 for n >= 11, and hence a(n) <= (4^(n-3)-1)/3 for n >= 11 since A347409((4^(n-3)-1)/3) = 2n - 6. - Charles R Greathouse IV, Oct 25 2022

Crossrefs

Programs

  • Mathematica
    A347409[n_]:=(c=n;sm=0;While[c>1,If[OddQ[c],c=3c+1,If[(s=IntegerExponent[c,2])>sm,sm=s];c/=2^s]];sm)
    upto=100000;a={};rec=-1;Do[If[(r=A347409[i])>rec,rec=r;AppendTo[a,i]],{i,upto}];a
  • PARI
    f(n)=my(nb=0); while (n != 1, if (n % 2, n=3*n+1, my(x = valuation(n, 2)); n /= 2^x; nb = max(nb, x)); ); nb; \\ A347409
    lista(nn) = my(r=-1, m); for (n=1, nn, if ((m=f(n)) > r, print1(n, ", "); r = m);); \\ Michel Marcus, Sep 10 2021

Extensions

a(15) from Michel Marcus, Sep 10 2021
a(16)-a(17) from Alois P. Heinz, Sep 10 2021
a(18)-a(20) from Michael S. Branicky, Sep 28 2021
a(21)-a(22) from Michael S. Branicky, Sep 30 2021
a(23) from Michael S. Branicky, Oct 04 2021
a(24)-a(27) from Kevin P. Thompson, Apr 14 2022

A359247 The bottom entry in the absolute difference triangle of the elements in the Collatz trajectory of n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0
Offset: 1

Views

Author

Michel Lagneau, Dec 22 2022

Keywords

Examples

			a(3) = 1 because the Collatz trajectory of 3 is T = [3, 10, 5, 16, 8, 4, 2, 1], and the absolute difference triangle of the elements of T is:
  3  . 10  .  5  . 16  .  8  .  4  .  2  .  1
     7  .  5  . 11  .  8  .  4  .  2  .  1
        2  .  6  .  3  .  4  .  2  .  1
           4  .  3  .  1  .  2  .  1
              1  .  2  .  1  .  1
                 1  .  1  .  0
                    0  .  1
                       1
with bottom entry a(3) = 1.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&];Flatten[Table[Collatz[n],{n,10}]];Table[d=Collatz[m];While[Length[d]>1,d=Abs[Differences[d]]];d[[1]],{m,100}]
  • PARI
    a(n) = my(list=List([n])); while (n!=1, if(n%2, n=3*n+1, n=n/2); listput(list, n)); my(v = Vec(list)); while (#v != 1, v = vector(#v-1, k, abs(v[k+1]-v[k]))); v[1]; \\ Michel Marcus, Dec 23 2022

Formula

a(2^n) = 1.

A160000 Number of partitions of n into parts occurring in '3x+1'-trajectory starting with n.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 9, 10, 17, 20, 23, 66, 35, 57, 51, 36, 77, 153, 122, 126, 61, 213, 189, 883, 353, 338, 337, 851, 645, 570, 571, 202, 1220, 1066, 901, 4017, 3462, 2440, 2777, 1598, 1852, 512, 8084, 4909, 3952, 3122, 3399, 29851, 17813, 11391, 11285, 7128
Offset: 1

Views

Author

Reinhard Zumkeller, May 11 2009

Keywords

Examples

			7-22-11-34-17-52-26-13-40-20-10-5-16-8-[4-2-1]*:
{1,2,4,5,7} is the set of numbers <= n, occurring in this trajectory, therefore a(7) = #{7, 5+2, 5+1+1, 4+2+1, 4+1+1+1, 2+2+2+1, 2+2+1+1+1, 2+1+1+1+1+1, 1+1+1+1+1+1+1} = 9.
		

Crossrefs

Programs

  • Haskell
    a160000 n = p (takeWhile (<= n) $ sort $ a070165_row n) n where
       p _          0 = 1
       p []         _ = 0
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Sep 01 2012

A160001 Number of partitions of n into distinct parts occurring in '3x+1'-trajectory starting with n.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 3, 1, 4, 3, 4, 9, 4, 8, 5, 1, 6, 18, 10, 5, 2, 13, 6, 25, 19, 10, 8, 41, 24, 14, 10, 1, 40, 19, 8, 138, 90, 55, 62, 7, 17, 3, 144, 63, 34, 16, 16, 43, 218, 148, 105, 22, 7, 39, 24, 323, 371, 150, 224, 54, 27, 40, 30, 1, 572, 444, 344, 71, 32, 19, 39, 1766, 52
Offset: 1

Views

Author

Reinhard Zumkeller, May 11 2009

Keywords

Examples

			7-22-11-34-17-52-26-13-40-20-10-5-16-8-[4-2-1]*:
{1,2,4,5,7} is the set of numbers <= n, occurring in this trajectory, therefore a(7) = #{7, 5+2, 4+2+1} = 3.
		

Crossrefs

Programs

  • Haskell
    a160001 n = p (takeWhile (<= n) $ sort $ a070165_row n) n where
       p _      0 = 1
       p []     _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Sep 01 2012

A174538 The smallest k such that the number of steps in the n Collatz sequences starting at k+i, i=0..n-1, is always prime.

Original entry on oeis.org

3, 3, 3, 60, 246, 560, 560, 560, 4722, 4722, 6032, 6666, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 13956, 81488, 81488, 81488, 83840, 89535, 89535, 89535, 282880, 282984, 282984, 282984, 282984
Offset: 1

Views

Author

Michel Lagneau, Mar 21 2010

Keywords

Comments

Indices of A006577 that start a run of at least n primes.
We find long sequences of primes, for example there are 55 primes starting at index 282984, namely 83, 101, 127, 251,...

Examples

			A006577(3)=7, A006577(4)=2 and A006577(5)=5 are all prime, so a(1)=a(2)=a(3) =3 mark the start of that run.
		

Crossrefs

Programs

  • Maple
    A174538 := proc(n)
            local k,allp;
            for k from 1 do
                    allp := true;
                    for i from 0 to n-1 do
                            if not isprime(A006577(k+i)) then
                                    allp := false;
                                    break;
                            end if;
                    end do:
                    if allp then
                            return k;
                    end if;
            end do:
    end proc: # R. J. Mathar, Jul 08 2012

Extensions

Edited by R. J. Mathar, Jul 08 2012

A213181 Number of chains of even numbers of length 2 or more in the Collatz (3x+1) trajectory of n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 3, 1, 4, 1, 3, 2, 2, 3, 2, 1, 3, 4, 4, 2, 1, 3, 2, 2, 5, 2, 17, 4, 4, 2, 16, 1, 6, 3, 2, 5, 4, 4, 6, 2, 17, 1, 6, 4, 4, 2, 16, 2, 5, 5, 5, 3, 2, 17, 17, 4, 7, 4, 6, 3, 3, 16, 15, 1, 6, 6, 5, 4, 3, 2, 16, 5, 18, 4, 2, 5, 5, 6, 6, 2, 4, 17, 17
Offset: 1

Views

Author

Jayanta Basu, Feb 28 2013

Keywords

Comments

A pair of even numbers that appear side by side in Collatz trajectory of n is considered a chain of length 2 and likewise for chains of greater length.

Examples

			For n=3, Collatz trajectory of 3 is 3,10,5,16,8,4,2,1, hence the only chain is 16,8,4,2 and so a(3)=1.
For n=12: 12,6,3,10,5,16,8,4,2,1 and as such there are two chains 12,6 and 16,8,4,2 so a(12)=2.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; evenCnt = 0; Do[If[OddQ[i], evenCnt = 0, evenCnt++; If[evenCnt == 2, cnt++]], {i, c}]; cnt, {n, 100}] (* T. D. Noe, Feb 28 2013 *)

Formula

a(n) = a(A363270(A014682(n))) + 1 for n >= 3. - Alan Michael Gómez Calderón, Apr 09 2025
a(n) = a(A139391(n)) + A133872(n) for n >= 2. - Alan Michael Gómez Calderón, Apr 23 2025

A214614 Irregular triangle read by rows: row n gives numbers <= n whose Collatz trajectory contains the trajectory of n.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 4, 5, 7, 1, 2, 4, 8, 1, 2, 4, 5, 7, 8, 9, 1, 2, 4, 5, 8, 10, 1, 2, 4, 5, 8, 10, 11, 1, 2, 3, 4, 5, 6, 8, 10, 12, 1, 2, 4, 5, 8, 10, 13, 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 1, 2, 4, 5, 8, 10, 15
Offset: 1

Views

Author

Jayanta Basu, Mar 06 2013

Keywords

Comments

Each row has A159999(n) elements and ends in n.

Examples

			Rows of triangle:
{1},
{1, 2},
{1, 2, 3},
{1, 2, 4},
{1, 2, 4, 5},
{1, 2, 3, 4, 5, 6},
{1, 2, 4, 5, 7},
{1, 2, 4, 8},
{1, 2, 4, 5, 7, 8, 9},
{1, 2, 4, 5, 8, 10}
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a214614 n k = a214614_tabf !! (n-1) (k-1)
    a214614_row n = a214614_tabf !! (n-1)
    a214614_tabf = zipWith f [1..] a070165_tabf where
                           f v ws = sort $ filter (<= v) ws
    -- Reinhard Zumkeller, Sep 01 2014
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; f[n_] := Module[{c = Collatz[n]}, Select[c, # <= n &]]; t = Table[f[n], {n, 20}]; Flatten[t] (* T. D. Noe, Mar 07 2013 *)

A217743 Excess of number of odds in the form 4k+1 over number of odds in the form 4k+3 in Collatz trajectory of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 3, 2, 3, 1, 3, 2, 0, 1, 4, 3, 3, 2, 2, 3, 1, 1, 4, 3, -6, 2, 4, 0, -6, 1, 5, 4, 2, 3, 3, 3, 2, 2, -5, 2, 4, 3, 5, 1, -5, 1, 4, 4, 4, 3, 3, -6, -6, 2, 5, 4, 3, 0, 2, -6, -8, 1, 5, 5, 3, 4, 4, 2, -4, 3, -5, 3, 2, 3, 5, 2, 2, 2, 3, -5, -5
Offset: 1

Views

Author

Jayanta Basu, Mar 23 2013

Keywords

Crossrefs

Cf. A217744 (n having equal numbers of 4k+1 and 4k+3 terms).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3*# + 1] &, n, # > 1 &]; Table[Length[Select[Collatz[n], Mod[#, 4] == 1 &]] - Length[Select[Collatz[n], Mod[#, 4] == 3 &]], {n,60}]
    Table[m4=Mod[NestWhileList[If[EvenQ[#],#/2,3*#+1]&,n,#>1&],4];Count[m4, 1]-Count[m4, 3], {n, 60}] (* Zak Seidov, Mar 23 2013 *)

A217744 Numbers whose Collatz trajectory contains equal number of terms of the form 4k+1 and 4k+3.

Original entry on oeis.org

15, 30, 60, 120, 151, 239, 240, 255, 302, 377, 423, 425, 478, 479, 480, 510, 593, 604, 669, 685, 743, 754, 755, 846, 847, 850, 851, 939, 956, 958, 960, 1020, 1053, 1057, 1186, 1191, 1208, 1297, 1321, 1338, 1341, 1370, 1375, 1473, 1486, 1487, 1508, 1509, 1510
Offset: 1

Views

Author

Jayanta Basu, Mar 23 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Collatz[n_] :=NestWhileList[If[EvenQ[#], #/2, 3*# + 1] &, n, # > 1 &]; t = {}; Do[If[Length[Select[Collatz[n], Mod[#, 4] == 1 &]] -Length[Select[Collatz[n], Mod[#, 4] == 3 &]] == 0, AppendTo[t, n]], {n, 1500}]; t

A219696 Numbers k such that the trajectory of 3k + 1 under the '3x + 1' map reaches k.

Original entry on oeis.org

1, 2, 4, 8, 10, 14, 16, 20, 22, 26, 40, 44, 52, 106, 184, 206, 244, 274, 322, 526, 650, 668, 790, 866, 976, 1154, 1300, 1438, 1732, 1780, 1822, 2308, 2734, 3238, 7288
Offset: 1

Views

Author

Robert C. Lyons, Nov 25 2012

Keywords

Comments

This sequence seems complete; there are no other terms <= 10^9. - T. D. Noe, Dec 03 2012
If the 3x+1 step is replaced with (3x+1)/2, the sequence becomes {1, 2, 4, 8, 10, 14, 20, 22, 26, 40, 44, 206, 244, 650, 668, 866, 1154, 1822, 2308, ...}. - Robert G. Wilson v, Jan 13 2015
From Andrew Slattery, Aug 03 2023: (Start)
For most terms k, the trajectory of 3k + 1 reaches 310 or the trajectory of 310 reaches k.
For the rest of the terms k, the trajectory of 3k + 1 reaches 22 or the trajectory of 22 reaches k.
With the exception of k = 1, k is reached after S steps,
where S = c*8 + d*13 + e*44 + f*75, with c, d, e and f in {0, 1, 2}; in particular, S is in {8, 13, 8+8, 8+13, 13+13, 44, 75, 44+44, 75+13+13, 75+44, 75+75}. (End)

Examples

			For k = 4, the Collatz trajectory of 3k + 1 is (13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which includes 4; thus, 4 is in the sequence.
For k = 5, the Collatz trajectory of 3k + 1 is (16, 8, 4, 2, 1), which does not include 5; thus, 5 is not in the sequence.
		

Crossrefs

Programs

  • Haskell
    a219696 n = a219696_list !! (n-1)
    a219696_list = filter (\x -> collatz'' x == x) [1..] where
       collatz'' x = until (`elem` [1, x]) a006370 (3 * x + 1)
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Select[Range[10000], MemberQ[Collatz[3 # + 1], #] &] (* T. D. Noe, Dec 03 2012 *)
  • PARI
    a006370(n) = if(n%2==0, n/2, 3*n+1)
    is(n) = my(x=3*n+1); while(1, x=a006370(x); if(x==n, return(1), if(x==1, return(0)))) \\ Felix Fröhlich, Jun 10 2021
  • Python
    def ok(n):
        if n==1: return [1]
        N=3*n + 1
        l=[N, ]
        while True:
            if N%2==1: N = 3*N + 1
            else: N/=2
            l+=[N, ]
            if N<2: break
        if n in l: return 1
        return 0 # Indranil Ghosh, Apr 22 2017
    

Extensions

Initial 1 from Clark R. Lyons, Dec 02 2012
Previous Showing 61-70 of 121 results. Next