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

A056576 Highest k with 2^k <= 3^n.

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 9, 11, 12, 14, 15, 17, 19, 20, 22, 23, 25, 26, 28, 30, 31, 33, 34, 36, 38, 39, 41, 42, 44, 45, 47, 49, 50, 52, 53, 55, 57, 58, 60, 61, 63, 64, 66, 68, 69, 71, 72, 74, 76, 77, 79, 80, 82, 84, 85, 87, 88, 90, 91, 93, 95, 96, 98, 99, 101, 103, 104, 106, 107
Offset: 0

Views

Author

Henry Bottomley, Jun 29 2000

Keywords

Examples

			a(3)=4 because 3^3=27 and 2^4=16 is power of 2 immediately below 27.
		

Crossrefs

Cf. A000079 (powers of 2), A000244 (powers of 3), A020914, A022921.
Cf. A056850, A117630 (complement), A020857 (decimal expansion of log_2(3)), A076227, A100982.

Programs

Formula

a(n) = floor(log_2(3^n)) = log_2(A000244(n)-A056576(n)) = a(n-1)+A022921(n-1).
a(n) = A020914(n) - 1. - L. Edson Jeffery, Dec 12 2014

A100982 Number of admissible sequences of order j; related to 3x+1 problem and Wagon's constant.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 30, 85, 173, 476, 961, 2652, 8045, 17637, 51033, 108950, 312455, 663535, 1900470, 5936673, 13472296, 39993895, 87986917, 257978502, 820236724, 1899474678, 5723030586, 12809477536, 38036848410, 84141805077, 248369601964
Offset: 1

Views

Author

Steven Finch, Jan 13 2005

Keywords

Comments

Eric Roosendaal counted all admissible sequences up to order j=1000 (2005). Note: there is a typo in both Wagon and Chamberland in the definition of Wagon's constant 9.477955... The expression floor(1 + 2*i + i*log_2(3)) should be replaced by floor(1 + i + i*log_2(3)).
The length of all admissible sequences of order j is A020914(j). - T. D. Noe, Sep 11 2006
Conjecture: a(n) is given for each n > 3 by a formula using a(2)..a(n-1). This allows us to create an iterative algorithm which generates a(n) for each n > 6. This has been proved for each n <= 53. For higher values of n the algorithm must be slightly modified. - Mike Winkler, Jan 03 2018
Theorem 1: a(k) is given for each k > 1 by a formula using a(1)..a(k-1). Namely, a(1)=1 and a(k+1) = Sum_{m=1..k} (-1)^(m-1)*binomial(floor((k-m+1)*(log(3)/log(2))) + m - 1, m)*a(k-m+1) for k >= 1. - Vladimir M. Zarubin, Sep 25 2015
Theorem 2: a(n) can be generated for each n > 2 algorithmically in a Pascal's triangle-like manner from the two starting values 0 and 1. This result is based on the fact that the Collatz residues (mod 2^k) can be evolved according to a binary tree. There is a direct connection with A076227, A056576 and A022921. - Mike Winkler, Sep 12 2017
A177789 shows another theorem and algorithm for generating a(n). - Mike Winkler, Sep 12 2017

Examples

			The unique admissible sequence of order 1 is 3/2, 1/2.
The unique admissible sequence of order 2 is 3/2, 3/2, 1/2, 1/2.
The two admissible sequences of order 3 are 3/2, 3/2, 3/2, 1/2, 1/2 and 3/2, 3/2, 1/2, 3/2, 1/2.
a(13) = 8045 = binomial(floor(5*(13-2)/3), 13-2)
- Sum_{i=2..6} binomial(floor((3*(13-i)+0)/2), 13-i)*a(i)
- Sum_{i=7..11} binomial(floor((3*(13-i)-1)/2), 13-i)*a(i)
- Sum_{i=12..12} binomial(floor((3*(13-i)-2)/2), 13-i)*a(i)
= 31824 - 4368*1 - 3003*2 - 715*3 - 495*7 - 120*12 - 28*30 - 21*85 - 5*173 - 4*476 - 1*961 - 0*2652. (Conjecture)
From _Mike Winkler_, Sep 12 2017: (Start)
The next table shows how Theorem 2 works. No entry is equal to zero.
n =       3  4  5   6   7   8   9  10  11   12 .. |A076227(k)=
--------------------------------------------------|
k =  2 |  1                                       |     1
k =  3 |  1  1                                    |     2
k =  4 |     2  1                                 |     3
k =  5 |        3   1                             |     4
k =  6 |        3   4   1                         |     8
k =  7 |            7   5   1                     |    13
k =  8 |               12   6   1                 |    19
k =  9 |               12  18   7   1             |    38
k = 10 |                   30  25   8   1         |    64
k = 11 |                   30  55  33   9    1    |   128
:      |                        :   :   :    : .. |    :
--------------------------------------------------|---------
a(n) =    2  3  7  12  30  85 173 476 961 2652 .. |
The entries (k,n) in this table are generated by the rule (k+1,n) = (k,n) + (k,n-1). The last value of (k+1,n) is given by k+1 = A056576(n-1), or the highest value in column n is given twice only if A022921(n-2) = 2. Then a(n) is equal to the sum of the entries in column n. For n = 7 there is 1 = 0 + 1, 5 = 1 + 4, 12 = 5 + 7, 12 = 12 + 0. Therefore a(7) = 1 + 5 + 12 + 12 = 30. The sum of row k is equal to A076227(k). (End)
From _Ruud H.G. van Tol_, Dec 04 2023: (Start)
A tree view.
n-tree--A098294--ids-----paths-----------------a(n)
0 ._          0  0       0                       -
1 |_          1  1       10                      1
2 |_._        2  2       1100                    1
3 |_|_        2  3-4     11010     -   11100     2
4 |_|_._      3  5-7     1101100   -  1111000    3
5 |_|_|_      3  8-14    11011010  - 11111000    7
6 |_|_|_._    4  15-26   1101101100-1111110000  12
7 |_|_|_|_._  5  27-56   ...                    30
8 |_|_|_|_|_  5  57-141  ...                    85
...
For n>=1, the endpoints are at A098294(n) to the right.
(End)
		

Crossrefs

Cf. A122790 (Wagon's constant), A076227, A056576, A022921, A098294, A177789.

Programs

  • Mathematica
    (* based on Eric Roosendaal's algorithm *) nn=100; Clear[x,y]; Do[x[i]=0, {i,0,nn+1}]; x[1]=1; t=Table[Do[y[cnt]=x[cnt]+x[cnt-1], {cnt,p+1}]; Do[x[cnt]=y[cnt], {cnt,p+1}]; admis=0; Do[If[(p+1-cnt)*Log[3]T. D. Noe, Sep 11 2006 *)
  • PARI
    /* translation of the above code from T. D. Noe */
    {limit=100; n=1; x=y=vector(limit+1); x[1]=1; for(b=2, limit, for(c=2, b+1, y[c]=x[c]+x[c-1]); for(c=2, b+1, x[c]=y[c]); a_n=0; for(c=1, b+1, if((b+1-c)*log(3)Mike Winkler, Feb 28 2015
    
  • PARI
    /* algorithm for the Conjecture */
    {limit=53; zn=vector(limit); zn[2]=1; zn[3]=2; zn[4]=3; zn[5]=7; zn[6]=12; f=1; e1=-1; e2=-2; for(n=7, limit, m=floor((n-1)*log(3)/log(2))-(n-1); j=(m+n-2)!/(m!*(n-2)!); if(n>6*f, if(frac(n/2)==0, e=e1, e=e2)); if(frac((n-6 )/12)==0, f++; e1=e1+2); if(frac((n-12)/12)==0, f++; e2=e2+2); Sum=a=b=0; c=1; d=5; until(c>=n-1, for(i=2+a*5+b, 1+d+a*5, if(i>11 && frac((i+2)/6)==0, b++); delta=e-a; Sum=Sum+binomial(floor((3*(n-i)+delta)/2),n-i)*zn[i]; c++); a++; for(k=3, 50, if(n>=k*6 && a==k-1, d=k+3))); zn[n]=j-Sum; print(n" "zn[n]))} \\ Mike Winkler, Jan 03 2018
    
  • PARI
    /* cf. code for Theorem 2 */
    {limit=100; /*or limit>100*/ p=q=vector(limit); c=2; w=log(3)/log(2); for(n=3, limit, p[1]=Sum=1; for(i=2, c, p[i]=p[i-1]+q[i]; Sum=Sum+p[i]); a_n=Sum; print(n" "a_n); for(i=1, c, q[i]=p[i]); d=floor(n*w)-floor((n-1)*w); if(d==2, c++)); } \\ Mike Winkler, Apr 14 2015
    
  • PARI
    /* algorithm for Theorem 1 */
    n=20; a=vector(n); log32=log(3)/log(2);
    {a[1]=1; for ( k=1, n-1, a[k+1]=sum( m=1,k,(-1)^(m-1)*binomial( floor( (k-m+1)*log32)+m-1,m)*a[k-m+1] ); print(k" "a[k]) );
    } \\ Vladimir M. Zarubin, Sep 25 2015
    
  • PARI
    /* algorithm for Theorem 2 */
    {limit=30; /*or limit>30*/ R=matrix(limit,limit); R[2,1]=0; R[2,2]=1; for(n=2, limit, print; print1("For n="n" in column n: "); Kappa_n=floor(n*log(3)/log(2)); a_n=0; for(k=n, Kappa_n, R[k+1,n]=R[k,n]+R[k,n-1]; print1(R[k+1,n]", "); a_n=a_n+R[k+1,n]); print; print(" and the sum is a(n)="a_n))} \\ Mike Winkler, Sep 12 2017

Formula

A sequence s(k), where k=1, 2, ..., n, is *admissible* if it satisfies s(k)=3/2 exactly j times, s(k)=1/2 exactly n-j times, s(1)*s(2)*...*s(n) < 1 but s(1)*s(2)*...*s(m) > 1 for all 1 < m < n.
a(n) = (m+n-2)!/(m!*(n-2)!) - Sum_{i=2..n-1} binomial(floor((3*(n-i)+b)/2), n-i)*a(i), where m = floor((n-1)*log_2(3))-(n-1) and b assumes different integer values within the sum at intervals of 5 or 6 terms. (Conjecture)
a(n) = Sum_{k=n-1..A056576(n-1)} (k,n). (Theorem 2, cf. example)
a(k) = 2*A076227(A020914(k)-1) - A076227(A020914(k)), for k > 0. - Vladimir M. Zarubin, Sep 29 2019
a(1)=1, a(n) = Sum_{k=0..A020914(n-1)-n-2} A325904(k)*binomial(A020914(n-1)-k-2, n-2) for n>1. - Benjamin Lombardo, Oct 18 2019

Extensions

Two more terms from Jules Renucci (jules.renucci(AT)wanadoo.fr), Nov 02 2005
More terms from T. D. Noe, Sep 11 2006

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

Original entry on oeis.org

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

Views

Author

Keywords

Comments

For n > 0, first differences of A022331. - Michel Marcus, Oct 03 2013

Crossrefs

Cf. A022924 (first differences).

Programs

Formula

a(n) = 1 + floor(n*log_3(2)) = 1 + floor(n*A102525) = 1 + A136409(n). - R. J. Mathar, May 23 2009
a(n) = A081604(A000079(n)). - Reinhard Zumkeller, Jul 12 2011
a(A020914(n)) = n + 1. - Reinhard Zumkeller, Mar 28 2015

Extensions

More terms from James Sellers

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

A243115 Starting values of the reduced Collatz function (A014682) where 2 to the power of the "dropping time" is greater than the starting value.

Original entry on oeis.org

3, 7, 11, 15, 23, 27, 31, 39, 47, 59, 63, 71, 79, 91, 95, 103, 111, 123, 127, 155, 159, 167, 175, 191, 199, 207, 219, 223, 231, 239, 251, 255, 283, 287, 303, 319, 327, 347, 359, 367, 383, 411, 415, 423, 447, 463, 479, 487, 495, 507, 511, 539, 543, 559, 575
Offset: 1

Views

Author

K. Spage, Aug 20 2014

Keywords

Comments

a(n) is the lowest positive starting value of the reduced Collatz function such that all starting values (>1) that are congruent to a(n) (mod 2^d) have the same dropping time (d). The dropping time here counts the (3x+1)/2 and the x/2 steps as listed in A126241. A number is included in this sequence if 2^A126241(a(n)) > a(n).
Starting values that produce new record dropping times as listed in A060412 are necessarily a subset of this sequence.
If at least one iteration is carried out before checking that the absolute iterated value has become less than or equal to the absolute starting value, then a(n) is the lowest positive starting value such that all starting values (positive, zero or negative) that are congruent to a(n) (mod 2^d) have the same dropping time (d). Defined like this, the sequence would start with 0, 1, 3, 7.
For k>0, A076227(k) is the number of terms between 2^k and 2^(k+1)-1. - Ruud H.G. van Tol, Dec 18 2022
All terms are congruent to 3 (mod 4) since any 1 (mod 4) has dropping time A126241(4k+1) = 2, for k>=1. - Ruud H.G. van Tol, Jan 11 2023

Examples

			3 is in this sequence because the dropping time starting with 3 is A126241(3) = 4 and 2^4 > 3.
		

Crossrefs

Programs

  • PARI
    is(t)= if(t<3||3!=t%4,0,my(x=t, d=0); until(x<=t, if(x%2, x=(x*3+1)/2, x/=2); d++); 2^d>t); \\ updated by Ruud H.G. van Tol, Jan 10 2023

Extensions

Offset 1 from Ruud H.G. van Tol, Jan 10 2023

A325904 Generator sequence for A100982.

Original entry on oeis.org

1, 0, -3, -8, 15, -91, -54, 2531, -17021, 43035, -66258, 1958757, -24572453, 146991979, -287482322, -3148566077, 35506973089, -198639977241, 1006345648929, -8250266425561, 76832268802555, -517564939540551, 1890772860334557, 3323588929061820, -104547561696315008, 907385094824827328, -6313246535826877248
Offset: 0

Views

Author

Benjamin Lombardo, Sep 08 2019

Keywords

Comments

The name of this sequence is derived from its main purpose as a formula for A100982 (see link). Both formulas below stem from Mike Winkler's 2017 paper on the 3x+1 problem (see below), in which a recursive definition of A100982 and A076227 is created in 2-D space. These formulas redefine the sequences in terms of this 1-D recursive sequence.

Crossrefs

Programs

  • Python
    import math
    numberOfTerms = 20
    L6 = [1,0]
    def c(n):
        return math.floor(n/(math.log2(3)-1))
    def p(a,b):
        return math.factorial(a)/(math.factorial(a-b)*math.factorial(b))
    def anotherTerm(newTermCount):
        global L6
        for a in range(newTermCount+1-len(L6)):
            y = len(L6)
            newElement = 0
            for k in range(y):
                newElement -= int(L6[k]*p(c(y)+y-k-2, c(y)-2))
            L6.append(newElement)
    anotherTerm(numberOfTerms)
    print("A325904")
    for a in range(numberOfTerms+1):
        print(a, "|", L6[a])
    
  • SageMath
    @cached_function
    def a(n):
        if n < 2: return 0^n
        A = floor(n/(log(3, 2) - 1)) - 2
        return -sum(a(k)*binomial(A + n - k, A) for k in (0..n-1))
    [a(n) for n in range(100)] # Peter Luschny, Sep 10 2019

Formula

a(0)=1, a(1)=0, a(n) = -Sum_{k=0..n-1} a(k)*binomial(A325913(n)+n-k-2, A325913(n)-2) for n>1.

A182137 Size of the set of b for numbers of the form 2^n*x + b that cannot be the smallest element of a set giving a duration of infinite flight in the Collatz problem.

Original entry on oeis.org

1, 3, 6, 13, 28, 56, 115, 237, 474, 960, 1920, 3870, 7825, 15650, 31473, 63422, 126844, 254649, 509298, 1021248, 2050541, 4101082, 8219801, 16490635, 32981270, 66071490, 132455435, 264910870, 530485275, 1060970550, 2123841570, 4253619813, 8507239626, 17027951548, 34095896991, 68191793982, 136471574881, 272943149762, 546144278026, 1093108792776, 2186217585552
Offset: 1

Views

Author

Jérôme STORTI, Apr 14 2012

Keywords

Comments

In the Collatz Problem A014682, it is possible to apply the algorithm to first degree polynomials like 2^n*x+b, where n is an integer and 0 <= b < 2^n. The iteration terminates by two cases:
1) a*x+b where a < 2^n: the polynomial is "minimized"
2) a*x+b where a is odd and a > 2^n, parity cannot be found. The polynomial cannot be minimized.
The sequence counts how many first degree polynomials end like first case for each n > 0.
The interest of this sequence is that every number that can be described by a minimized polynomial cannot be the smallest element of a set of value of T(n) = infinity.

Examples

			Example with 4x+b (0 <= b < 4):
4x is even, thus gives 2x, 2 < 4 (first case).
4x+1, is odd thus 3(4x+1)+1 = 12x+4 is even, thus (12x+4)/2/2=3x+1 3 < 4, first case.
4x+2 is even, (4x+2)/2=2x+1, 2 < 4, first case.
4x+3 with same way gives 9x+8. 9 is odd and 9 > 4, second case.
That explains why the second (n=2) term in sequence is 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{b, p0, p1, minimized = 0}, For[b = 1, b <= 2^n, b++, {p0, p1} = {b, 2^n}; While[Mod[p1, 2] == 0 && p1 >= 2^n, {p0, p1} = If[Mod[p0, 2] == 0, {p0/2, p1/2}, {3*p0+1, 3*p1}]; If[p1<2^n, minimized += 1]]]; minimized]; Table[Print[an = a[n]]; an, {n, 1, 40}] (* Jean-François Alcover, Feb 12 2014, translated from D. S. McNeil's Sage code *)
  • PARI
    upto(P=18)= my(r=Vec([1, 1], P)); forstep(x=3,2^P,4, my(s=x, p=0); until(s<=x, s= if(s%2, 3*s+1, s)/2; if(p++ > P, next(2))); if((2^p>x), r[p]++)); for(i=2, #r, r[i]+= 2*r[i-1]); print(r); \\ Ruud H.G. van Tol, Mar 13 2023
  • Sage
    def A182137(n):
        minimized = 0
        for b in range(2**n):
            p = [b, 2**n]
            while p[1] % 2 == 0 and p[1] >= 2**n:
                p[0],p[1] = [p[0]/2, p[1]/2] if p[0] % 2 == 0 else [3*p[0]+1, 3*p[1]]
            if p[1] < 2**n: minimized += 1
        return minimized # D. S. McNeil, Apr 14 2012
    

Formula

a(n) = 2^n - A076227(n) for n >= 2. - Ruud H.G. van Tol, Mar 13 2023
For n not in A020914, a(n) = 2*a(n-1). - Ruud H.G. van Tol, Apr 12 2023

Extensions

More terms from D. S. McNeil, Apr 14 2012
a(31) from Jérôme STORTI, Apr 22 2012
a(32)-a(38) from Jérôme STORTI, Jul 21 2012
a(39) from Jérôme STORTI, Jul 26 2012
a(40) from Jérôme STORTI, Feb 08 2014
a(37) and a(39) corrected by Jérôme STORTI, Dec 29 2021
Showing 1-7 of 7 results.