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

A226720 Complement of A122437.

Original entry on oeis.org

2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 18, 20, 22, 23, 25, 27, 28, 30, 31, 33, 35, 36, 38, 40, 41, 43, 45, 46, 48, 49, 51, 53, 54, 56, 58, 59, 61, 62, 64, 66, 67, 69, 71, 72, 74, 76, 77, 79, 80, 82, 84, 85, 87, 89, 90, 92, 93, 95, 97, 98, 100, 102, 103, 105, 107
Offset: 1

Views

Author

Clark Kimberling, Jun 16 2013

Keywords

Comments

Suppose that b and c are integers satisfying 1 < b < c. Let x = 1 + log_b(c) and y = 1 + log_c(b). Jointly rank all the numbers b^k for k>=0 and c^k for k>=1; then for n >= 0, the position of b^n is 1 + floor(n*y), and for n >=1, the position of c^n is 1+ floor(n*x).
These position sequences are closely related to the Beatty sequences given by floor(n*x) and floor(n*y).

Examples

			The joint ranking of the powers of 2 and of 3 begins like this: 1, 2, 3, 4, 8, 9, 16, 27, 32, 64. The numbers 2^n for n >= 1 are in positions 2, 4, 5, 7, 9, 10.
		

Crossrefs

Programs

  • Mathematica
    b = 2; c=3; Floor[1 + Range[0, 100]*(1 + Log[b, c])]  (* A123384 *)
    Floor[1 + Range[1, 100]*(1 + Log[c, b])]  (* A226721 *)

A122442 Least k such that the Collatz (3x+1) iteration starting with k has "dropping time" A122437(n).

Original entry on oeis.org

2, 5, 3, 11, 7, 39, 287, 231, 191, 127, 359, 511, 239, 159, 639, 283, 991, 251, 167, 111, 1695, 1307, 871, 927, 671, 155, 103, 1639, 91, 3431, 3399, 2287, 71, 6395, 47, 31, 2047, 27, 1819, 17691, 6887, 4591, 13439, 6383, 4255, 7963, 7527, 12399, 7279, 1583
Offset: 1

Views

Author

T. D. Noe, Sep 06 2006

Keywords

Crossrefs

Cf. A122437 (allowable "dropping times" of the Collatz iteration).

Programs

  • Mathematica
    With[{s = 1 + Log2[3]}, {2}~Join~Table[(k = 3; While[-1 + Length@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, k, # >= k &] != m, k += 2]; k), {m, Array[Floor[1 + s*#] &, 50]}] ] (* Michael De Vlieger, Apr 19 2024 *)

A177789 Irregular triangle read by rows in which row n gives the congruences (mod 2^A020914(n)) satisfied by the numbers having dropping time A122437(n+1) in the Collatz (3x+1) iteration.

Original entry on oeis.org

0, 1, 3, 11, 23, 7, 15, 59, 39, 79, 95, 123, 175, 199, 219, 287, 347, 367, 423, 507, 575, 583, 735, 815, 923, 975, 999, 231, 383, 463, 615, 879, 935, 1019, 1087, 1231, 1435, 1647, 1703, 1787, 1823, 1855, 2031, 2203, 2239, 2351, 2587, 2591, 2907, 2975, 3119
Offset: 0

Views

Author

T. D. Noe, May 13 2010

Keywords

Comments

The dropping time is the number of Collatz iterations required to reach a lower number than starting value. Garner mentions these congruences. The first term in row n is A122442(n+1) for n > 1. The length of row n is A100982(n).
The triangle means:
numbers 0 (mod 2) and > 0 have dropping time 1;
numbers 1 (mod 4) and > 1 have dropping time 3;
numbers 3 (mod 16) have dropping time 6;
numbers 11, 23 (mod 32) have dropping time 8;
numbers 7, 15, 59 (mod 128) have dropping time 11;
numbers 39, 79, 95, 123, 175, 199, 219 (mod 256) have dropping time 13.
Theorem: a(n) can be evaluated using a directed rooted tree produced by a precise algorithm. Each node of this tree is given by a unique Diophantine equation whose only positive solutions are the integers with a finite stopping time. The algorithm generates (in a three step loop) the parity vectors which define the Diophantine equations. The two directions of the construction principle gives the tree a triangular form which extends ever more downwards with each column. There exist explicit arithmetic relationships between the parent and child vertices. As a consequence, a(n) can be generated algorithmically. The algorithm also generates A100982. - Mike Winkler, Sep 12 2017

Examples

			Triangle begins:
   0;
   1;
   3;
  11,  23;
   7,  15,  59;
  39,  79,  95, 123, 175, 199, 219;
  ...
From _Mike Winkler_, Sep 12 2017: (Start)
The beginning of the directed rooted tree produced by the algorithm of the Theorem. The triangular form can be seen clearly. The way the tree structure is sorting a(n), respectively the residue classes, mirrors the explicit arithmetic relationships mentioned in the Theorem.
3 (mod 2^4) -- 11 (mod 2^5) -- 59 (mod 2^7) -- 123 (mod 2^8) --
                    |                                |
                    |                          219 (mod 2^8) --
                    |
                    |
               23 (mod 2^5) --- 7 (mod 2^7) -- 199 (mod 2^8) --
                                    |                |
                                    |           39 (mod 2^8) --
                                    |
                                    |
                               15 (mod 2^7) --- 79 (mod 2^8) --
                                                     |
                                               175 (mod 2^8) --
                                                     |
                                                95 (mod 2^8) --
(End)
		

Crossrefs

Cf. A060445 (dropping time of odd numbers), A100982.

Programs

  • Mathematica
    DroppingTime[n_] := Module[{m=n, k=0}, If[n>1, While[m>=n, k++; If[EvenQ[m], m=m/2, m=3*m+1]]]; k]; dt=Floor[1+Range[0,20]*Log[2,6]]; e=Floor[1+Range[0,20]*Log[2,3]]; Join[{0,1}, Flatten[Table[Select[Range[3,2^e[[n]],2], DroppingTime[ # ]==dt[[n]] &], {n,2,8}]]]
  • PARI
    /* algorithm for generating the parity vectors of the Theorem, the tree structure is given by the three STEP's */
    {k=3; Log32=log(3)/log(2); limit=14; /*or limit>14*/ T=matrix(limit,60000); xn=3; /*initial tuple for n=1*/ A=[]; for(i=1, 2, A=concat(A,i)); A[1]=1; A[2]=1; T[1,1]=A; for(n=2, limit, print("n="n); Sigma=floor(1+(n+1)*Log32); d=floor(n*Log32)-floor((n-1)*Log32); Kappa=floor(n*Log32); Kappa2=floor((n-1)*Log32);r=1; v=1; until(w==0, A=[]; for(i=1, Kappa2+1, A=concat(A,i)); A=T[n-1,v]; B=[]; for(i=1, Kappa+1, B=concat(B,i)); for(i=1, Kappa2+1, B[i]=A[i]); /* STEP 1 */ if(d==1, B[k]=1; T[n,r]=B; r++; v++); if(d==2, B[k]=0; B[k+1]=1; T[n,r]=B; r++; v++); /* STEP 2 */ if(B[Kappa]==0, for(j=1, Kappa-n, B[Kappa+1-j]=B[Kappa+2-j]; B[Kappa+2-j]=0; T[n,r]=B; r++; if(B[Kappa-j]==1, break(1)))); /* STEP 3 */ w=0; for(i=n+2, Kappa+1, w=w+B[i]));k=k+d; p=1; h2=3; for(i=1, r-1, h=0; B=T[n,i]; until(B[h]==0, h++); if(h>h2, p=1; h2++; print); print(T[n,i]"  "p"  "i); p++); print)} \\ Mike Winkler, Sep 12 2017
    
  • PARI
    row(n) = if (n < 2, [n], my(v = vector(2^(A020914(n)-1), k, 2*k-1)); apply(x->2*x-1, Vec(select(x->(x == 1+A122437(n+1)), apply(A074473, v), 1)))); \\ Michel Marcus, Aug 15 2025
    
  • PARI
    row(n)={if(n<1, [0], my(r=[1], d=[2], km=2); for(i=1, n-1, my(temp1=[], temp2=[], c=if(3^(i+1)<2^(km+1),1,2)); for(j=1, #d, temp1=concat(temp1, vector(d[j]-1, m, 3*r[j]+2^(km-d[j]+m))); temp2=concat(temp2, vector(d[j]-1, m, d[j]-m+c))); km=km+c; r=temp1; d=temp2; ); vecsort(apply(x->((-x)*lift(Mod(1/3^n, 2^km)))%2^km, r)))} \\ V. Barbera, Aug 15 2025

A020914 Number of digits in the base-2 representation of 3^n.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 24, 26, 27, 29, 31, 32, 34, 35, 37, 39, 40, 42, 43, 45, 46, 48, 50, 51, 53, 54, 56, 58, 59, 61, 62, 64, 65, 67, 69, 70, 72, 73, 75, 77, 78, 80, 81, 83, 85, 86, 88, 89, 91, 92, 94, 96, 97, 99, 100, 102, 104, 105, 107
Offset: 0

Views

Author

Keywords

Comments

Also, numbers k such that the first digit in the ternary expansion of 2^k is 1. - Mohammed Bouayoun (Mohammed.bouayoun(AT)sanef.com), Apr 24 2006
a(n) is the smallest integer such that n/a(n) < log_2(3). - Trevor G. Hyde (thyde12(AT)amherst.edu), Jul 31 2008
This sequence represents allowable values of the "dropping time" in the Collatz (3x+1) problem when iterated according to the function f(n) := n/2 if n is even, (3n+1)/2 otherwise, as tabulated in A126241. There is one exception, A126241(1), which has been set to zero by convention. - K. Spage, Oct 22 2009
An integer k is a term of A020914 if and only if floor(k*(1 + log(2)/log(3))) - abs(k-1)*(1 + log(2)/log(3)) - 1 >= 0. - K. Spage, Oct 22 2009
Also smallest k such that ceiling(2^k / 3^n) = 2. - Michel Lagneau, Jan 31 2012
For n > 0, first differences of A022330. - Michel Marcus, Oct 03 2013
Also the number of powers of two less than or equal to 3^n. - Robert G. Wilson v, May 25 2014
Except for 1, A020914 is the complement of A054414 and therefore these two form a pair of Beatty sequences. - Robert G. Wilson v, May 25 2014

Crossrefs

Cf. A056576, A054414, A070939, A000244, A227048, A022330, A022921 (first differences), A126241.
Cf. A020857 (decimal expansion of log_2(3)).
Cf. A020915.
Cf. A204399 (essentially the same).

Programs

Formula

a(n) = floor(1 + n*log(3)/log(2)). - K. Spage, Oct 22 2009
a(0) = 1, a(n+1) = a(n) + A022921(n). - K. Spage, Oct 23 2009
a(n) = A122437(n-1) - n. - K. Spage, Oct 23 2009
A098294(n) = a(n) + n for n > 0. - Mike Winkler, Dec 31 2010
a(n) = A070939(A000244(n)) = length of n-th row in triangle A227048. - Reinhard Zumkeller, Jun 30 2013
a(n) = 1 + floor(n*log_2(3)) = 1 + A056576(n) = 1 + floor(n*A020857). - L. Edson Jeffery, Dec 12 2014
A020915(a(n)) = n + 1. - Reinhard Zumkeller, Mar 28 2015

Extensions

More terms from Stefan Steinerberger, Apr 19 2006

A060445 "Dropping time" in 3x+1 problem starting at 2n+1 (number of steps to reach a lower number than starting value). Also called glide(2n+1).

Original entry on oeis.org

0, 6, 3, 11, 3, 8, 3, 11, 3, 6, 3, 8, 3, 96, 3, 91, 3, 6, 3, 13, 3, 8, 3, 88, 3, 6, 3, 8, 3, 11, 3, 88, 3, 6, 3, 83, 3, 8, 3, 13, 3, 6, 3, 8, 3, 73, 3, 13, 3, 6, 3, 68, 3, 8, 3, 50, 3, 6, 3, 8, 3, 13, 3, 24, 3, 6, 3, 11, 3, 8, 3, 11, 3, 6, 3, 8, 3, 65, 3, 34, 3, 6, 3, 47, 3, 8, 3, 13, 3, 6, 3, 8, 3
Offset: 0

Views

Author

N. J. A. Sloane, Apr 07 2001

Keywords

Comments

If the starting value is even then of course the next step in the trajectory is smaller (cf. A102419).
The dropping time can be made arbitrarily large: If the starting value is of form n(2^m)-1 and m > 1, the next value is 3n(2^m)-3+1. That divided by 2 is 3n(2^(m-1))-1. It is bigger than the starting value and of the same form - substitute 3n -> n and m-1 -> m, so recursively get an increasing subsequence of m odd values. The dropping time is obviously longer than that. This holds even if Collatz conjecture were refuted. For example, m=5, n=3 -> 95, 286, 143, 430, 215, 646, 323, 970, 485, 1456, 728, 364, 182, 91. So the subsequence in reduced Collatz variant is 95, 143, 215, 323, 485. - Juhani Heino, Jul 21 2017

Examples

			3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2, taking 6 steps, so a(1) = 6.
		

Crossrefs

A060565 gives the first lower number that is reached. Cf. A060412-A060415, A217934.
See A074473, A102419 for other versions of this sequence.
Cf. A122437 (allowable dropping times), A122442 (least k having dropping time A122437(n)).
Cf. A070165.

Programs

  • Haskell
    a060445 0 = 0
    a060445 n = length $ takeWhile (>= n') $ a070165_row n'
                where n' = 2 * n + 1
    -- Reinhard Zumkeller, Mar 11 2013
    
  • Mathematica
    nxt[n_]:=If[OddQ[n],3n+1,n/2]; Join[{0},Table[Length[NestWhileList[nxt, n,#>=n&]]-1, {n,3,191,2}]]  (* Harvey P. Dale, Apr 23 2011 *)
  • Python
    def a(n):
        if n<1: return 0
        n=2*n + 1
        N=n
        x=0
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            x+=1
            if nIndranil Ghosh, Apr 22 2017

Extensions

More terms from Jason Earls, Apr 08 2001 and from Michel ten Voorde Apr 09 2001
Still more terms from Larry Reeves (larryr(AT)acm.org), Apr 12 2001

A098294 a(n) = ceiling(n*log_2(3/2)).

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 34, 35, 36, 36, 37, 37, 38, 39, 39, 40, 40, 41, 41, 42, 43, 43, 44
Offset: 0

Views

Author

Wolfdieter Lang, Oct 18 2004

Keywords

Comments

Original name was: Smallest exponent of 2 which gives a power of 2 which is equal to or bigger than (3/2)^n, n = 0,1,... .
Stacking perfect fifths (the frequency ratio of a fifth is 3/2) this sequence determines into which octave the n-th fifth falls. For example, the third fifth, (3/2)^3, falls into the second octave, which means that it lies in the interval [2^1,2^2)=[2,4). The k-th octave comprises ratios in the interval [2^(k-1),2^k), k=1,2,...
Related to the initial number of sequential even terms in an "ideal" sequence under iteration of the 3x+1 Problem on a positive odd value m, where the piecewise function f is given by f(2*m)=m, f(2*m+1)=6*m+4, to ensure f^A122437(n) (m) < m, where n > 1 is the number of odds in the sequence (including m) and floor(1+n*(log(3)/log(2))) is the number of evens. An "ideal" sequence minimizes the effects of f(2*m+1) by following a certain order of even or odd terms along with the rules of the function. A representation of such sequences in terms of parity sequences for values n >= 2 follows:
n=2, (o,e,e,o,e,e)
n=3, (o,e,e,o,e,o,e,e)
n=4, (o,e,e,e,o,e,o,e,o,e,e)
n=5, (o,e,e,e,o,e,o,e,o,e,o,e,e)
n=6, (o,e,e,e,e,o,e,o,e,o,e,o,e,o,e,e)
n=7, (o,e,e,e,e,e,o,e,o,e,o,e,o,e,o,e,o,e,e)
The pattern is clear, and the formula for the initial number of sequential even terms in each sequence is given by a(n) = floor(1+n*(log(3)/log(2)))-n for n > 1, where the sum of the number of even and odd terms is given by A122437(n) for n > 1. Of course, most values m do not have sequences following this pattern of iteration under f. Also, the reason for placing an extra even term at the end of such sequences is to mitigate to some degree the effects of the possibility that the last odd term is only "slightly" larger than m, i.e., (3*m+1)/4 < m for all m > 1. - Jeffrey R. Goodwin, Aug 25 2011
a(n) gives the position in n-th row of A227048 where (3^n - 2^n) occurs:
A227048(n,a(n)) = A001047(n). - Reinhard Zumkeller, Jun 30 2013
Differs from A005378 at indices n = 0,17,20,22,25,27,29,30,... - M. F. Hasler, Jun 29 2014

Examples

			a(0) = 0 because 2^0 = 1 = (3/2)^0 but 2^(-1) = 1/2 < 1.
a(11) = 7 because 2^7 = 128 > 86.497... = (3/2)^11 but 2^6 = 64 < (3/2)^11.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a098294 0  = 0
    a098294 n  = fromJust (a001047 n `elemIndex` a227048_row n) + 1
    -- Reinhard Zumkeller, Jun 30 2013
    
  • Magma
    [0] cat [Floor(1 + n * Log(3)/Log(2)) - n: n in [1..70]]; // Vincenzo Librandi, Jul 13 2015
    
  • Maple
    seq(ceil(n*log[2](3/2)),n=0..100); # Robert Israel, Jul 12 2015
  • Mathematica
    With[{c=Log2[3/2]},Ceiling[c*Range[0,80]]] (* Harvey P. Dale, Feb 24 2024 *)
  • PARI
    a(n)=ceil(n*log(3/2)/log(2)) \\ Charles R Greathouse IV, Jul 13 2015
    
  • PARI
    a(n) = !!n + logint(3^n, 2) - n \\ Ruud H.G. van Tol, Nov 21 2023

Formula

2^a(n) >= (3/2)^n but 2^(a(n) - 1) < (3/2)^n, n >= 0.
a(n) = ceiling(tau*n) with tau := log(3)/log(2) - 1 = 0.584962501..., n >= 0.
a(n) = floor(1 + n * log(3)/log(2)) - n, n >= 1. - Mike Winkler, Dec 31 2010

A022921 Number of integers m such that 3^n < 2^m < 3^(n+1).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Represents increments between successive terms of allowable dropping times in the Collatz (3x+1) problem. That is, a(n) = A020914(n+1) - A020914(n). - K. Spage, Oct 23 2009

Examples

			From _Amiram Eldar_, Mar 01 2024: (Start)
a(0) = 1 because 3^0 = 1 < 2^1 = 2 < 3^1 = 3.
a(1) = 2 because 3^1 = 3 < 2^2 = 4 < 2^3 = 8 < 3^2 = 9.
a(2) = 1 because 3^2 = 9 < 2^4 = 16 < 3^3 = 27. (End)
		

Crossrefs

See also A020857 (decimal expansion of log_2(3)).

Programs

  • Maple
    Digits := 100: c1 := log(3.)/log(2.): A022921 := n->floor((n+1)*c1)-floor(n*c1);
    seq(ilog2(3^(n+1)) - ilog2(3^n), n=0 .. 1000); # Robert Israel, Dec 11 2014
  • Mathematica
    i2 = 1; Table[p = i2; While[i2++; 2^i2 < 3^(n + 1)]; i2 - p, {n, 0, 98}] (* T. D. Noe, Feb 28 2014 *)
    f[n_] := Floor[ Log2[ 3^n] + 1]; Differences@ Array[f, 106, 0] (* Robert G. Wilson v, May 25 2014 *)
  • PARI
    a(n) = logint(3^(n+1),2) - logint(3^n,2) \\ Ruud H.G. van Tol, Dec 28 2022
    
  • PARI
    Vec(matreduce([logint(2^i,3)|i<-[1..158]])[,2])[1..-2] \\ Ruud H.G. van Tol, Dec 29 2022

Formula

a(n) = floor((n+1)*log_2(3)) - floor(n*log_2(3)).
a(n) = A122437(n+2) - A122437(n+1) - 1. - K. Spage, Oct 23 2009
First differences of A020914. - Robert G. Wilson v, May 25 2014
First differences of A056576. - L. Edson Jeffery, Dec 12 2014
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = log_2(3) (A020857). - Amiram Eldar, Mar 01 2024

A122790 Decimal expansion of Wagon's constant: the average "dropping time" of the Collatz (3x+1) iteration.

Original entry on oeis.org

9, 4, 7, 7, 9, 5, 5, 5, 5, 6, 5, 5, 9, 2, 7, 4, 7, 3, 6, 9, 1, 6, 6, 8, 1, 0, 1, 2, 5, 8, 9, 0, 4, 1, 9, 4, 2, 2, 8, 1, 8, 7, 1, 6, 0, 4, 4, 2, 7, 2, 9, 9, 7, 1, 5, 9, 2, 7, 4, 4, 2, 3, 5, 6, 6, 6, 7, 0, 1, 5, 3, 2, 2, 1, 6, 2, 4, 8, 2, 8, 1, 7, 7, 5, 6, 1, 0, 6, 8, 5, 6, 5, 5, 7, 3, 1, 0, 4, 0, 2, 6, 4, 4, 4, 3
Offset: 1

Views

Author

T. D. Noe, Sep 11 2006

Keywords

Crossrefs

Cf. A060445 (dropping time of the 3x+1 iteration starting at 2n+1), A100982, A122791.

Formula

Sum_{k>0} A122437(k+1)*A100982(k)/2^(A020914(k)-1) = 9.47795555655927473691668101258904...

A206807 Position of 3^n when {2^j} and {3^k} are jointly ranked; complement of A206805.

Original entry on oeis.org

2, 5, 7, 10, 12, 15, 18, 20, 23, 25, 28, 31, 33, 36, 38, 41, 43, 46, 49, 51, 54, 56, 59, 62, 64, 67, 69, 72, 74, 77, 80, 82, 85, 87, 90, 93, 95, 98, 100, 103, 105, 108, 111, 113, 116, 118, 121, 124, 126, 129, 131, 134, 137, 139, 142, 144, 147, 149, 152, 155
Offset: 1

Views

Author

Clark Kimberling, Feb 16 2012

Keywords

Comments

The joint ranking is for j >= 1 and k >= 1, so that the sets {2^j} and {3^k} are disjoint.

Examples

			The joint ranking begins with 2,3,4,8,9,16,27,32,64,81,128,243,256, so that
A206805 = (1,3,4,6,8,9,11,13,...)
A206807 = (2,5,7,10,12,...)
		

Crossrefs

Programs

  • Mathematica
    f[n_] := 2^n; g[n_] := 3^n; z = 200;
    c = Table[f[n], {n, 1, z}]; s = Table[g[n], {n, 1, z}];
    j = Sort[Union[c, s]];
    p[n_] := Position[j, f[n]]; q[n_] := Position[j, g[n]];
    Flatten[Table[p[n], {n, 1, z}]]           (* A206805 *)
    Table[n + Floor[n*Log[3, 2]], {n, 1, 50}] (* A206805 *)
    Flatten[Table[q[n], {n, 1, z}]]           (* this sequence *)
    Table[n + Floor[n*Log[2, 3]], {n, 1, 50}] (* this sequence as a table *)
  • PARI
    a(n) = logint(3^n, 2) + n; \\ Ruud H.G. van Tol, Dec 10 2023

Formula

a(n) = n + floor(n*log_2(3)).
A206805(n) = n + floor(n*log_3(2)).
a(n) = n + A056576(n). - Michel Marcus, Dec 12 2023
a(n) = A098294(n) + 2*n - 1. - Ruud H.G. van Tol, Jan 22 2024

A381707 Smallest initial value for unimodal Collatz (3x+1)/2 glide sequence that begins with exactly n increases.

Original entry on oeis.org

5, 3, 23, 15, 95, 575, 383, 255, 5631, 25599, 104447, 69631, 745471, 3293183, 2195455, 12648447, 97910783, 65273855, 43515903, 1460666367, 6700400639, 4466933759, 71697432575, 47798288383, 764873277439, 1242923270143, 3760646520831, 8371159695359, 5580773130239, 3720515420159
Offset: 1

Views

Author

David Dewan, Mar 04 2025

Keywords

Comments

A unimodal Collatz glide sequence is successive rises x -> (3x+1)/2 followed by successive falls x -> x/2 until dropping below its starting x.
After n increases, there are ceiling(n*log(3)/log(2) - n) decreases to drop below the initial value.

Examples

			For n=3, the smallest starting x = a(3) = 23 has trajectory
  23 - 35 -> 53 ->  80  -> 40 -> 20
     \-----------/      \------/
     n=3 increases   decreases to < initial
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=2^n ModularInverse[3^n,2^Max[Ceiling[Log2[3^n]-n],2]]-1; Array[a,30]
  • PARI
    a(n)={my(m=2^(logint(3^n,2) - n + 1 + (n==1))); 2^n*lift(1/Mod(3^n,m)) - 1} \\ Andrew Howroyd, Mar 09 2025

Formula

a(n) = 2^n * (3^(-n) mod 2^max(2, ceiling(log2(3^n)-n))) - 1.
Showing 1-10 of 10 results.