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.

A065447 Concatenation of 1, 00, 111, 0000, ..., n 1's (if n is odd) or n 0's (if n is even).

Original entry on oeis.org

1, 100, 100111, 1001110000, 100111000011111, 100111000011111000000, 1001110000111110000001111111, 100111000011111000000111111100000000, 100111000011111000000111111100000000111111111, 1001110000111110000001111111000000001111111110000000000
Offset: 1

Views

Author

Lior Manor, Nov 18 2001

Keywords

Comments

a(n) is divisible by A002275([(n+1)/2]) = (10^[(n+1)/2]-1)/9. Cf. A262806. - Max Alekseyev, Jun 02 2013
The unique sequence of binary words a(n) such that the k-th run of a(n) has length k, for k = 1..n . - Clark Kimberling, Mar 08 2024

Examples

			a(2) = 100, the concatenation of one 1, two 0's.
a(3) = 100111, the concatenation of one 1, two 0's, three 1's.
a(4) = 1001110000, the concatenation of one 1, two 0's, three 1's, four 0's.
		

Crossrefs

For decimal version see A065760.

Programs

  • Maple
    a:= n-> parse(cat((irem(i,2)$i)$i=1..n)):
    seq(a(n), n=1..10);  # Alois P. Heinz, Mar 08 2024
  • Mathematica
    FoldList[Join, {1}, Map[ConstantArray[Mod[#, 2], #] &, Range[2, 10]]] (* Peter J. C. Moses, Mar 08 2024 *)
  • PARI
    { m=10; for (n=1, 44, if (n==1, a=1, m*=10; a*=m; if (n%2, a+=(m - 1)/9)); write("b065447.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 19 2009

A065761 Concatenation of increasing number of alternating digits in base 2, starting with 0.

Original entry on oeis.org

0, 3, 24, 399, 12768, 817215, 104603520, 26778501375, 13710592704000, 14039646928897023, 28753196910381103104, 117773094544920998318079, 964797190511992818221703168, 15807237169348490333744384720895
Offset: 1

Views

Author

Lior Manor, Nov 18 2001

Keywords

Comments

The first 5 terms in base 2 are 0, (0)11, (0)11000, (0)110001111, (0)11000111100000.

Examples

			a(5) = 12768 is formed by appending 0 five times (00000) to a(4) in base 2: (0)11000111100000.
		

Crossrefs

Programs

  • PARI
    baseI(x, b)= { local(d, e=0, f=1); while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) } { c=1; for (n=1, 50, if (n==1, a=0; b=0, c=c*10 + 1; if (n%2, d=0, d=c); b=b*10^n + d; a=baseI(b, 2)); write("b065761.txt", n, " ",a) ) } \\ Harry J. Smith, Oct 30 2009

Formula

a(1) = 0; a(n+1) = append n+1 0's or 1's (alternately) to a(n).

A371033 a(n) is the integer whose binary expansion starts with 1 and such that the runs of identical bits have lengths n, n-1, n-2, ..., 3, 2, 1.

Original entry on oeis.org

1, 6, 57, 966, 31801, 2065350, 266370105, 68453106630, 35115918982201, 35993681099981766, 73750982613738224697, 302157703921043555451846, 2475577920866839506242796601, 40562343629382474008388259775430, 1329187433441286490429798672020569145
Offset: 1

Views

Author

Clark Kimberling, Mar 18 2024

Keywords

Examples

			Representations as binary words (as in A371032) have decreasing runlengths:
    1:  1
    6:  110
   57:  111001
  966:  1111000110  (runlengths 4,3,2,1)
		

Crossrefs

Cf. A006125, A007088, A065760, A126883, A371032 (binary version).

Programs

  • Maple
    a:= n-> Bits[Join]([seq((1-(n-i) mod 2)$i, i=1..n)]):
    seq(a(n), n=1..15);  # Alois P. Heinz, Jul 09 2024
  • Mathematica
    Map[FromDigits[#, 2] &, Table[Flatten[Map[ConstantArray[Mod[#, 2], n + 1 - #] &, Range[n]]], {n, 16}]]    (* Peter J. C. Moses, Mar 08 2024 *)
  • Python
    def A371033(n):
        c = 0
        for i in range(n):
            c <<= n-i
            if i&1^1:
                c += (1<Chai Wah Wu, Mar 18 2024

Formula

a(n) == n (mod 2). - Alois P. Heinz, Jul 09 2024
a(n) = 2^(n*(n+1)/2) - 1 - a(n-1). - Robert Israel, Jul 09 2024

Extensions

New name from Michel Marcus, Jul 09 2024
a(15) corrected by Alois P. Heinz, Jul 09 2024
Showing 1-3 of 3 results.