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-4 of 4 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)).

A200675 Powers of 2 repeated 4 times.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 32, 32, 32, 32, 64, 64, 64, 64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512, 1024, 1024, 1024, 1024, 2048, 2048, 2048, 2048, 4096, 4096, 4096, 4096
Offset: 0

Author

Jeremy Gardiner, Nov 20 2011

Keywords

Comments

Run lengths in A173922.

Examples

			a(4) = 2^1 = 2.
		

Programs

  • Mathematica
    CoefficientList[Series[x*(1 + x)*(1 + x^2)/(1 - 2*x^4), {x,0,50}],x] (* or *) Table[2^(Floor[n/4]), {n,0,50}] (* G. C. Greubel, Apr 30 2017 *)
  • PARI
    a(n)=2^(n\4) \\ Charles R Greathouse IV, Oct 03 2016
    
  • Python
    def A200675(n): return 1<<(n>>2) # Chai Wah Wu, Jan 30 2023

Formula

a(n) = 2^floor(n/4).
G.f.: x*(1+x)*(1+x^2)/(1-2*x^4 ). - R. J. Mathar, Nov 21 2011

Extensions

Offset corrected by Charles R Greathouse IV, Oct 03 2016

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

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 0
Offset: 0

Author

Reinhard Zumkeller, Mar 04 2010

Keywords

Comments

a(n) = A173920(n+8,8).
a(n) = A000035(A132292(A030101(n+8)+1)).

Crossrefs

Programs

  • Mathematica
    Table[PadRight[{},2^Floor[n/8],Mod[n,2]],{n,0,30}]//Flatten (* Harvey P. Dale, Aug 07 2021 *)

Extensions

Sequence definition changed for clarity (see A173922).
Showing 1-4 of 4 results.