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.

A079944 A run of 2^n 0's followed by a run of 2^n 1's, for n=0, 1, 2, ...

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 21 2003

Keywords

Comments

With offset 2, this is the second bit in the binary expansion of n. - Franklin T. Adams-Watters, Feb 13 2009
a(n) = A173920(n+2,2); in the sequence of nonnegative integers (cf. A001477) substitute all n by 2^floor(n/2) occurrences of (n mod 2). - Reinhard Zumkeller, Mar 04 2010

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. See Example 1.34.

Crossrefs

Programs

  • Haskell
    a079944 n = a079944_list !! n
    a079944_list =  f [0,1] where f (x:xs) = x : f (xs ++ [x,x])
    -- Reinhard Zumkeller, Oct 14 2010, Mar 28 2011
    
  • Mathematica
    Table[IntegerDigits[n + 2, 2][[2]], {n, 0, 100}] (* Jean-François Alcover, Jul 26 2019 *)
  • PARI
    a(n)=binary(n+2)[2] \\ Charles R Greathouse IV, Nov 07 2016

Formula

a(n) = floor(log[2](4*(n+2)/3)) - floor(log[2](n+2)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
For n >= 2, a(n-2)=1+floor(log[2](n/3))-floor(log[2](n/2)) - Benoit Cloitre, Mar 03 2003
G.f.: 1/x^2/(1-x) * (1/x + sum(k>=0, x^(3*2^k)-x^2^(k+1))). - Ralf Stephan, Jun 04 2003
a(n) = A000035(A004526(A030101(n+2))). - Reinhard Zumkeller, Mar 04 2010

A173920 Triangle read by rows: T(n,k) = convolution of n with k in binary representation, 0<=k<=n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 04 2010

Keywords

Comments

T(n,k) = SUM(bn(i)*bk(L-i-1): 0<=iA070939(n), n=SUM(bn(i)*2^i:0<=i
T(n,2*k+1) = T(n,2*k) + 1;
T(n,k) <= MIN{A000120(n),A000120(k)};
row sums give A173921; central terms give A159780;
T(n,0) = A000004(n);
T(n,1) = A000012(n) for n>0;
T(n,2) = A079944(n-2) for n>1;
T(n,3) = A079882(n-2) for n>2;
T(n,4) = A173922(n-4) for n>3;
T(n,8) = A173923(n-8) for n>7;
T(n,n) = A159780(n).

Examples

			T(13,10) = T('1101','1010') = 1*0 + 1*1 + 0*0 + 1*1 = 2;
T(13,11) = T('1101','1011') = 1*1 + 1*1 + 0*0 + 1*1 = 3;
T(13,12) = T('1101','1100') = 1*0 + 1*0 + 0*1 + 1*1 = 1;
T(13,13) = T('1101','1101') = 1*1 + 1*0 + 0*1 + 1*1 = 2.
Triangle begins:
  0;
  0, 1;
  0, 1, 0;
  0, 1, 1, 2;
  0, 1, 0, 1, 0;
  0, 1, 0, 1, 1, 2;
  ...
		

Programs

  • Mathematica
    T[n_, k_] := Module[{bn, bk, lg},
         bn = IntegerDigits[n, 2];
         bk = IntegerDigits[k, 2];
         lg = Max[Length[bn], Length[bk]];
         ListConvolve[PadLeft[bn, lg], PadLeft[bk, lg]]][[1]];
    Table[T[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 19 2021 *)

Formula

T(n,k) = c(A030101(n),k,0) with c(x,y,z) = if y=0 then z else c([x/2],[y/2],z+(x mod 2)*(y mod 2)).

A173922 In the sequence of nonnegative integers substitute all n by 2^floor(n/4) occurrences of (n mod 2).

Original entry on oeis.org

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

Author

Reinhard Zumkeller, Mar 04 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[ConstantArray[Mod[n, 2], 2^Floor[n/4]], {n, 0, 20}]] (* Paolo Xausa, Apr 03 2024 *)

Formula

a(n) = A173920(n+4,4).
a(n) = A000035(A002265(A030101(n+4))).

Extensions

Sequence definition changed for clarity.
Showing 1-3 of 3 results.