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 34 results. Next

A073941 a(n) = ceiling((Sum_{k=1..n-1} a(k)) / 2) for n >= 2 starting with a(1) = 1.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 6, 9, 14, 21, 31, 47, 70, 105, 158, 237, 355, 533, 799, 1199, 1798, 2697, 4046, 6069, 9103, 13655, 20482, 30723, 46085, 69127, 103691, 155536, 233304, 349956, 524934, 787401, 1181102, 1771653, 2657479, 3986219, 5979328, 8968992
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 20 2002

Keywords

Comments

a(n) is the number of even integers that have n-1 digits when written in base 3/2. For example, there are 2 even integers that use three digits in base 3/2: 6 and 8: they are written as 210 and 212, respectively. - Tanya Khovanova and PRIMES STEP Senior group, Jun 03 2018
From Petros Hadjicostas, Jul 20 2020: (Start)
We describe Schuh's counting-off game (pp. 373-375 and 377-379). Assume m people are standing on a circle and they are labeled 1 through m (say clockwise). We start with the person labeled 1 and every 3rd person drops out (in a variation of the famous Josephus problem). The process is repeated until only one person is left.
This sequence describes those numbers m for which either the person labeled 1 or the person labeled 2 is the last survivor.
From a(4) = 2 to a(53) = 775795914 (see T. D. Noe's b-file), the values agree with those in Schuh (1968, p. 374) and Burde (1987, p. 207). a(54) = 1163693871 while both Schuh and Burde have 1063693871 (a difference in the 2nd digit starting on the left). a(55) = 1745540806 while both Schuch and Burde have 1595540806.
Schuh (1968) obtains the numbers in the following way. Suppose we know a(n) and the corresponding number i(n) of the last survivor (i(n) = 1 or 2). We multiply a(n) by 3/2 (cf. Burde's use of fractional bases).
If the product is an integer, that is a(n+1) and the corresponding last survivor is the same.
If the product is not an integer, then a(n+1) = floor(a(n)*3/2) if the last survivor i(n) = 2 (and the new last survivor is i(n+1) = 1), and a(n+1) = ceiling(a(n)*3/2) if the last survivor is i(n) = 1 (and the new last survivor is i(n+1) = 2).
Note that a(53) = 775795914 and a(54) = (3/2)*a(53) = 1163693871 (not 1063693871), so it seems Schuh did a mistake and Burde copied it. Also (3/2)*1163693871 = 1745540806.5. Since a(53) = 775795914 corresponds to number 2, we round down, i.e., a(54) = 1745540806 (and move to number 1). If, however, we multiply the incorrect 1063693871 by 3/2 and round down, we get Schuh and Burde's incorrect value 1595540806 for a(54).
Numbers a(n) that correspond to last survivors being number 1 are tabulated in A081614 while numbers a(n) that correspond to last survivors being number 2 are tabulated in A081615. (End)
a(n) is the number of times (n-1) appears in A061420. - Chinmaya Dash, Aug 19 2020

References

  • Fred Schuh, The Master Book of Mathematical Recreations, Dover, New York, 1968. [See Table 18, p. 374. Only the terms from a(6) = 4 forward are shown in the table. The table is definitely related to this sequence.]

Crossrefs

Same as log_2(A082125(n)), for n > 2. - Ralf Stephan, Apr 16 2002
Apart from initial term, same as A005428, which has further information.
a(n+4) = A079719(n)+2. Cf. A082416.
Partial sums for various start indices are in A006999, A061419, A061418. - Ralf Stephan, Apr 17 2003
Is this the same as A081848/3?
The constant c is (2/9)*K(3) (see A083286). - Ralf Stephan, May 29 2003

Programs

  • Haskell
    a073941 n = a073941_list !! (n-1)
    a073941_list = 1 : f [1] where
       f xs = x' : f (x':xs) where x' = (1 + sum xs) `div` 2
    -- Reinhard Zumkeller, Oct 26 2011
    
  • Mathematica
    f[s_] := Append[s, Ceiling[Plus @@ s/2]]; Nest[f, {1}, 41] (* Robert G. Wilson v, Jul 07 2006 *)
  • PARI
    v=vector(100);s=v[1]=1;for(i=2,#v,s+=(v[i]=(s+1)\2));v \\ Charles R Greathouse IV, Feb 11 2011
    
  • Python
    from itertools import islice
    def A073941_gen(): # generator of terms
        a, c = 1, 0
        yield 1
        while True:
            yield (a:=(c:=c+a)+1>>1)
    A073941_list = list(islice(A073941_gen(),70)) # Chai Wah Wu, Sep 20 2022

Formula

a(n) = ceiling(c*(3/2)^n-1/2) where c = 0.3605045561966149591015446628665... - Benoit Cloitre, Nov 22 2002
If 2^m divides a(i) then 2^(m-1)*3^1 divides a(i+1) and so on... until finally, 3^m divides a(i+m). - Ralf Stephan, Apr 20 2003
a(n) = A081848(n)/3. - Tom Edgar, Jul 21 2014
a(n) = A005428(n-2). - Tanya Khovanova and PRIMES STEP Senior group, Jun 03 2018

A024629 n written in fractional base 3/2.

Original entry on oeis.org

0, 1, 2, 20, 21, 22, 210, 211, 212, 2100, 2101, 2102, 2120, 2121, 2122, 21010, 21011, 21012, 21200, 21201, 21202, 21220, 21221, 21222, 210110, 210111, 210112, 212000, 212001, 212002, 212020, 212021, 212022, 212210, 212211, 212212, 2101100, 2101101
Offset: 0

Views

Author

Keywords

Comments

A246435(n) = (number of digits in a(n)) = A055642(a(n)). - Reinhard Zumkeller, Sep 05 2014
The number of positive even n such that a(n) has k+1 digits is A005428(k). - Glen Whitney, Jul 09 2017
The position of the rightmost "2" digit in a(3k), k >= 1, appears to be A087088(k). - Peter Munn, Jun 24 2020 [updated Peter Munn, Jul 14 2020 for new A087088 offset]

Examples

			Representations of the first few numbers are:
   0 =         0
   1 =         1
   2 =         2
   3 =       2 0
   4 =       2 1
   5 =       2 2
   6 =     2 1 0
   7 =     2 1 1
   8 =     2 1 2
   9 =   2 1 0 0
  10 =   2 1 0 1
  11 =   2 1 0 2
  12 =   2 1 2 0
  13 =   2 1 2 1
  14 =   2 1 2 2
  15 = 2 1 0 1 0
[extended and reformatted by _Peter Munn_, Jun 27 2020]
		

Crossrefs

Cf. A081848, A087088, A246435 (string lengths), A244040 (digit sums).

Programs

  • Haskell
    a024629 0 = 0
    a024629 n = 10 * a024629 (2 * n') + t where (n', t) = divMod n 3
    -- Reinhard Zumkeller, Sep 05 2014
  • Maple
    a:= proc(n) `if`(n<1, 0, irem(n, 3, 'q')+a(2*q)*10) end:
    seq(a(n), n=0..45);  # Alois P. Heinz, Jun 19 2018
  • Mathematica
    a[ n_] := If[ n < 1, 0, a[ Quotient[n, 3] 2] 10 + Mod[ n, 3]]; (* Michael Somos, Jun 18 2014 *)
  • PARI
    {a(n) = if( n<1, 0, a(n\3 * 2) * 10 + n%3)}; /* Michael Somos, Jun 18 2014 */
    
  • SageMath
    def basepqExpansion(p,q,n):
        L, i = [n], 1
        while L[i-1] >= p:
            x=L[i-1]
            L[i-1]=x.mod(p)
            L.append(q*(x//p))
            i+=1
        L.reverse()
        return Integer(''.join(str(x) for x in L))
    [basepqExpansion(3,2,n) for n in [0..40]] # Tom Edgar, Hailey R. Olafson, and James Van Alstine, Jun 17 2014; modified and corrected by G. C. Greubel, Aug 20 2019
    

Formula

To represent a number in base b, if a digit is >= b, subtract b and carry 1. In fractional base a/b, subtract a and carry b.
a(0)=0, a(3n+r) = 10*a(2n)+r for n >= 0 and r = 0, 1, 2. - Jianing Song, Oct 15 2022

Extensions

Tanton link corrected by Charles R Greathouse IV, Oct 20 2008

A246435 Length of representation of n in fractional base 3/2.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 05 2014

Keywords

Crossrefs

Cf. A024629, A055642, A070989, A081604, A081848 (run lengths), A244040.

Programs

  • Haskell
    a246435 n = if n < 3 then 1 else a246435 (2 * div n 3) + 1
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Mathematica
    a[n_] := If[n < 3, 1, a[2 Quotient[n, 3]] + 1]; Array[a, 100, 0] (* Jean-François Alcover, Feb 05 2019 *)
  • PARI
    a(n) = if(n < 3, 1, a(n\3 * 2) + 1); \\ Amiram Eldar, Jul 30 2025

Formula

a(n) = if n < 3 then 1, otherwise a(2*floor(n/3)) + 1.
a(n) = A055642(A024629(n)).

A070885 a(n) = (3/2)*a(n-1) if a(n-1) is even; (3/2)*(a(n-1)+1) if a(n-1) is odd.

Original entry on oeis.org

1, 3, 6, 9, 15, 24, 36, 54, 81, 123, 186, 279, 420, 630, 945, 1419, 2130, 3195, 4794, 7191, 10788, 16182, 24273, 36411, 54618, 81927, 122892, 184338, 276507, 414762, 622143, 933216, 1399824, 2099736, 3149604, 4724406, 7086609, 10629915
Offset: 1

Views

Author

Eric W. Weisstein, May 14 2002

Keywords

Comments

The smallest positive number such that A024629(a(n)) has n digits, per page 9 of the Tanton reference in Links. - Glen Whitney, Sep 17 2017

References

  • Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, 2002, p. 123.

Crossrefs

The constant K is 2/3*K(3) (see A083286). - Ralf Stephan, May 29 2003
Cf. A003312.
Cf. A081848.
Cf. A205083 (parity of terms).

Programs

  • Haskell
    a070885 n = a070885_list !! (n-1)
    a070885_list = 1 : map (flip (*) 3 . flip div 2 . (+ 1)) a070885_list
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Maple
    A070885 := proc(n)
        option remember;
        if n = 1 then
            return 1;
        elif type(procname(n-1),'even') then
            procname(n-1) ;
        else
            procname(n-1)+1 ;
        end if;
        %*3/2 ;
    end proc:
    seq(A070885(n),n=1..80) ; # R. J. Mathar, Jun 18 2018
  • Mathematica
    NestList[If[EvenQ[#],3/2 #,3/2 (#+1)]&,1,40] (* Harvey P. Dale, May 18 2018 *)
  • Python
    from itertools import islice
    def A070885_gen(): # generator of terms
        a = 1
        while True:
            yield a
            a += (a+1>>1)+(a&1)
    A070885_list = list(islice(A070885_gen(),70)) # Chai Wah Wu, Sep 20 2022

Formula

For n > 1, a(n) = 3*A061419(n) = 3*floor(K*(3/2)^n) where K=1.08151366859... - Benoit Cloitre, Aug 18 2002
a(n) = 3*ceiling(a(n-1)/2). - Benoit Cloitre, Apr 25 2003
a(n+1) = a(n) + A081848(n), for n > 1. - Reinhard Zumkeller, Sep 05 2014

A245356 Number of numbers whose base-4/3 expansion (see A024631) has n digits.

Original entry on oeis.org

4, 4, 4, 4, 8, 8, 12, 16, 20, 28, 36, 48, 64, 88, 116, 156, 208, 276, 368, 492, 656, 872, 1164, 1552, 2068, 2760, 3680, 4904, 6540, 8720, 11628, 15504, 20672, 27560, 36748, 48996, 65328, 87104, 116140, 154852, 206472, 275296, 367060, 489412, 652552, 870068
Offset: 1

Views

Author

Hailey R. Olafson, Jul 18 2014

Keywords

Examples

			a(3) = 4 because 320, 321, 322, and 323 are the base-4/3 expansions for the numbers 9, 10, 11, and 12 respectively and these are the only numbers with 3 digits.
		

Crossrefs

Programs

  • Sage
    A=[1]
    for i in [1..60]:
        A.append(ceil(((4-3)/3)*sum(A)))
    [4*x for x in A]

Formula

a(n) = 4*A072493(n).

A303500 The smallest positive even integer that can be written with n digits in base 3/2.

Original entry on oeis.org

2, 21, 210, 2101, 21011, 210110, 2101100, 21011000, 210110001, 2101100011, 21011000110, 210110001101, 2101100011010, 21011000110100, 210110001101001, 2101100011010011, 21011000110100110, 210110001101001101
Offset: 0

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, May 09 2018

Keywords

Comments

a(n) is a prefix of a(n+1).
The smallest, not necessarily even, integer in base 3/2 with n digits is a(n-1) with 0 added at the end.

Examples

			The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore, 210 is the smallest even integer with 3 digits in base 3/2.
		

Crossrefs

See A024629 for the base-3/2 expansion of n.

Programs

  • Maple
    roll32 := proc(L)
        local piv,L1 ;
        piv := 1;
        L1 := subsop(piv=op(piv,L)+1,L) ;
        while op(piv,L1) >= 3 do
            L1 := [seq(0,i=1..piv), op(piv+1,L1)+1, seq(op(i,L1),i=piv+2..nops(L1))] ;
            piv := piv+1 ;
        end do:
        L1 ;
    end proc:
    from32 := proc(L)
        add( op(i,L)*(3/2)^(i-1),i=1..nops(L)) ;
    end proc:
    A303500 := proc(n)
        local dgs ;
        dgs := [seq(0,i=1..n-1),1] ;
        while not type(from32(dgs),'even') do
            dgs := roll32(dgs) ;
        end do:
        dgs := ListTools[Reverse](dgs) ;
        digcatL(%) ;
    end proc: # R. J. Mathar, Jun 25 2018

Formula

a(n) = A024629(A305498(n)). - R. J. Mathar, Jun 25 2018

A304024 a(n) is the largest integer with n digits in base 3/2.

Original entry on oeis.org

2, 22, 212, 2122, 21222, 212212, 2122112, 21221112, 212211122, 2122111222, 21221112212, 212211122122, 2122111221212, 21221112212112, 212211122121122, 2122111221211222, 21221112212112212, 212211122121122122
Offset: 0

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, May 04 2018

Keywords

Comments

Every number starts and ends with 2 and contains only twos and ones.
Removing the last digit produces sequence A304272 of the largest even integers in base 3/2.
The value of this sequence in base 10 is A304025.
When adding 1 to the value of this sequence we get A070885.
The largest integer with a given number of digits in base 3/2 can be produced directly from the smallest number, sequence A304023, by replacing 21 at the beginning and 0 at the end with 2, and by shifting the rest up by 1, see sequence A304023.

Examples

			The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore, 22 is the largest two-digit integer.
		

Crossrefs

Programs

  • PARI
    first(n) = {my(res=vector(n), c = 2); res[1]=2; for(i=2, n, res[i] = 10 * res[i-1] + 2; if(c % 2 == 1, res[i] -= 10); c = 3 * c / 2 + if(c%2==0, 2, 1/2)); res} \\ David A. Corneth, May 11 2018

Formula

a(1) = 2, for n > 1, a(n) = 10 * a(n - 1) + 2 if A304025(n - 1) is even. Otherwise, a(n) = 10 * a(n - 1) - 8. - David A. Corneth, May 11 2018

A304025 a(n) is the largest integer that can be written with n digits in base 3/2.

Original entry on oeis.org

2, 5, 8, 14, 23, 35, 53, 80, 122, 185, 278, 419, 629, 944, 1418, 2129, 3194, 4793, 7190, 10787, 16181, 24272, 36410, 54617, 81926, 122891, 184337, 276506, 414761, 622142, 933215, 1399823, 2099735, 3149603, 4724405, 7086608, 10629914
Offset: 1

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, May 04 2018

Keywords

Comments

A070885 is the smallest integer that can be written with n digits in base 3/2.
This sequence represented in base 3/2 is A304024.

Examples

			The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore, 5 is the largest integer needing two digits in base 3/2.
		

Crossrefs

Programs

  • PARI
    first(n) = {my(res = vector(n)); res[1] = 2; for(i = 2, n, res[i] = 3 * res[i-1] / 2 + if(res[i-1] % 2==0, 2, 1/2));res} \\ David A. Corneth, May 11 2018

Formula

a(n) = A070885(n+1) - 1.

A304272 The largest even integer that can be written with n digits in base 3/2.

Original entry on oeis.org

2, 21, 212, 2122, 21221, 212211, 2122111, 21221112, 212211122, 2122111221, 21221112212, 212211122121, 2122111221211, 21221112212112, 212211122121122, 2122111221211221, 21221112212112212, 212211122121122121, 2122111221211221212, 21221112212112212121, 212211122121122121211, 2122111221211221212112
Offset: 1

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, May 09 2018

Keywords

Comments

a(n) is a prefix of a(n+1).
The largest, not necessarily even, integer in base 3/2 with n digits is a(n-1) with 2 added at the end.

Examples

			The number 4 in base 3/2 is 21, and number 6 is 210. Therefore, 21 is the largest even integer with 2 digits in base 3/2.
		

Crossrefs

Programs

  • Mathematica
    Table[StringTake["212211122121122121211221211212112", n], {n, 32}]

A304273 The concatenation of the first n terms is the smallest positive even number with n digits when written in base 3/2 (cf. A024629).

Original entry on oeis.org

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

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, May 09 2018

Keywords

Comments

This sequence exists since the smallest even integers (see A303500) are prefixes of each other.
Apparently a variant of A205083. - R. J. Mathar, Jun 09 2018

Examples

			The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore 210 is the smallest even integer with 3 digits in base 3/2. Its prefix 21 is 4: the smallest even integer with 2 digits in base 3/2.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 2*n,
          (t-> t+irem(t, 2))(b(n-1)*3/2))
        end:
    a:= n-> b(n)-3/2*b(n-1):
    seq(a(n), n=1..105);  # Alois P. Heinz, Jun 21 2018
  • Mathematica
    b[n_] := b[n] = If[n < 2, 2*n, Function[t, t + Mod[t, 2]][3/2 b[n - 1]]]; a[n_] := b[n] - 3/2 b[n - 1]; Table[a[n], {n, 1, 105}] (* Robert P. P. McKone, Feb 12 2021 *)

Formula

For n>1, a(n) = A304274(n-1) - 1.

Extensions

More terms from Alois P. Heinz, Jun 21 2018
Showing 1-10 of 34 results. Next