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-2 of 2 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

A065760 Concatenation of increasing number of alternating digits in base 2, starting with 1.

Original entry on oeis.org

1, 4, 39, 624, 19999, 1279936, 163831935, 41940975360, 21473779384831, 21989150090066944, 45033779384457103359, 184458360358736295358464, 1511082888058767731576545279, 24757582037954850514150117851136, 811256448219704541647671061746057215
Offset: 1

Views

Author

Lior Manor, Nov 18 2001

Keywords

Examples

			a(5) = 19999 is formed by appending 1 five times (11111) to a(4) in base 2: 100111000011111.
		

Crossrefs

Decimal version of A065447.
Cf. A065761.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          (t-> (a(n-1)+t)*2^n-t)(irem(n,2)))
        end:
    seq(a(n), n=1..17);  # Alois P. Heinz, Mar 08 2024
  • Mathematica
    With[{nn=20}, Table[FromDigits[Flatten[Take[Table[Table[If[EvenQ[n],0,1], {n}], {n,nn}], j]], 2], {j, nn}]] (* Harvey P. Dale, Sep 09 2012 *)
  • 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=1; b=1, c=c*10 + 1; if (n%2, d=c, d=0); b=b*10^n + d; a=baseI(b, 2)); write("b065760.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 30 2009

Formula

a(n) = a(n-1) * 2^n if n is even, (a(n-1) + 1) * 2^n - 1 if n is odd. - Franklin T. Adams-Watters, Sep 18 2012
Showing 1-2 of 2 results.