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-6 of 6 results.

A173921 Sums of rows of the triangle in A173920.

Original entry on oeis.org

0, 1, 1, 4, 2, 5, 6, 12, 4, 7, 9, 14, 12, 19, 21, 32, 8, 11, 17, 22, 19, 27, 30, 40, 24, 35, 37, 52, 41, 57, 60, 80, 16, 19, 33, 38, 34, 41, 51, 60, 40, 51, 57, 70, 64, 81, 85, 104, 48, 67, 69, 92, 76, 99, 101, 128, 84, 111, 113, 144, 118, 151, 155, 192, 32, 35, 65, 70, 66, 73
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 04 2010

Keywords

Comments

a(n) = SUM(A173920(n,k): 0<=k<=n);
a(A000225(n)) = A001787(n);
a(A000079(n)) = A011782(n);
a(A000051(n)) = A062709(n) for n>0;
A000120(n)<=a(n)<=A000788(n); a(n)=A000788(n) iff n=2^k-1.

Crossrefs

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

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 21 2003

Keywords

Comments

In the sequence of nonnegative integers (cf. A001477) substitute all n by 2^floor(n/2) occurrences of (1 + n mod 2); a(n)=A173920(n+2,3) for n>0. [From Reinhard Zumkeller, Mar 04 2010]

Crossrefs

Partial sums give A079945. Equals 1 + A079944. Cf. A080584.
First differences of A080637.

Programs

  • Maple
    f1 := n->[seq(1,i=1..2^n)]; f2 := n->[seq(2,i=1..2^n)]; s := []; for i from 0 to 10 do s := [op(s), op(f1(i)), op(f2(i))]; od: s;
  • Mathematica
    Table[{PadRight[{},2^n,1],PadRight[{},2^n,2]},{n,0,5}]//Flatten (* Harvey P. Dale, Jul 22 2016 *)

Formula

a(n) = floor(log[2](8*(n+2)/3)) - floor(log[2](n+2)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003

A159780 Inner product of the binary representation of n and its reverse.

Original entry on oeis.org

0, 1, 0, 2, 0, 2, 1, 3, 0, 2, 0, 2, 0, 2, 2, 4, 0, 2, 0, 2, 1, 3, 1, 3, 0, 2, 2, 4, 1, 3, 3, 5, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 2, 4, 2, 4, 0, 2, 2, 4, 0, 2, 2, 4, 0, 2, 2, 4, 2, 4, 4, 6, 0, 2, 0, 2, 0, 2, 0, 2, 1, 3, 1, 3, 1, 3, 1, 3, 0, 2, 0, 2, 2, 4, 2, 4, 1, 3, 1, 3, 3, 5, 3, 5, 0, 2, 2, 4, 0, 2, 2, 4, 1
Offset: 0

Views

Author

T. D. Noe, Apr 22 2009

Keywords

Comments

a(n) gives the number of 1's that coincide in the binary representation of n and its reverse. For the n in A140900, we have a(n)=0. The number k first appears at n=2^k-1.
Also central terms and right edge of the triangle in A173920: a(n)=A173920(2*n,n)=A173920(n,n). [From Reinhard Zumkeller, Mar 04 2010]
a(A000225(n)) = n and a(m) < n for m < A000225(n). [Reinhard Zumkeller, Oct 21 2011]
a(n) = sum(A030308(n,k)*A030308(n,A070939(n)-1-k): k = 0..A070939(n)-1). - Reinhard Zumkeller, Mar 10 2013

Examples

			14 is represented by the binary vector (1,1,1,0). The reverse is (0,1,1,1). The inner product is 1*0+1*1+1*1+0*1 = 2. Hence a(14) = 2.
		

Crossrefs

Cf. A216176.

Programs

  • Haskell
    a159780 n = sum $ zipWith (*) bs $ reverse bs
       where bs = a030308_row n
    -- Reinhard Zumkeller, Mar 10 2013, Oct 21 2011
  • Mathematica
    Table[d=IntegerDigits[n,2]; d.Reverse[d], {n,0,1023}]

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

Views

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.

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

Views

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-6 of 6 results.