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

A086100 A086099 in binary.

Original entry on oeis.org

0, 0, 1, 0, 11, 10, 11, 0, 111, 110, 111, 100, 111, 110, 111, 0, 1111, 1110, 1111, 1100, 1111, 1110, 1111, 1000, 1111, 1110, 1111, 1100, 1111, 1110, 1111, 0, 11111, 11110, 11111, 11100, 11111, 11110, 11111, 11000, 11111, 11110, 11111, 11100
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 09 2003

Keywords

Comments

a(n) = A007088(A086099(n)).

Crossrefs

Programs

  • PARI
    a(n) = n++; (10^logint(n,2) - 10^valuation(n,2))/9; \\ Kevin Ryde, Apr 11 2023

A142150 The nonnegative integers interleaved with 0's.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, 0, 32, 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 15 2008

Keywords

Comments

Number of vertical pairs in a wheel with n equal sections. - Wesley Ivan Hurt, Jan 22 2012
Number of even terms of n-th row in the triangles A162610 and A209297. - Reinhard Zumkeller, Jan 19 2013
Also the result of writing n-1 in base 2 and multiplying the last digit with the number with its last digit removed. See A115273 and A257844-A257850 for generalization to other bases. - M. F. Hasler, May 10 2015
Also follows the rule: a(n+1) is the number of terms that are identical with a(n) for a(0..n-1). - Marc Morgenegg, Jul 08 2019

Crossrefs

Programs

Formula

a(n) = XOR{k AND (n-k): 0<=k<=n}.
a(n) = (n/2)*0^(n mod 2); a(2*n)=n and a(2*n+1)=0.
a(n) = floor(n^2/2) mod n. - Enrique Pérez Herrero, Jul 29 2009
a(n) = A027656(n-2). - Reinhard Zumkeller, Nov 05 2009
a(n) = Sum_{k=0..n} (k mod 2)*((n-k) mod 2). - Reinhard Zumkeller, Nov 05 2009
a(n+1) = A000217(n) mod A000027(n+1) = A000217(n) mod A001477(n+1). - Edgar Almeida Ribeiro (edgar.a.ribeiro(AT)gmail.com), May 19 2010
From Bruno Berselli, Oct 19 2010: (Start)
a(n) = n*(1+(-1)^n)/4.
G.f.: x^2/(1-x^2)^2.
a(n) = 2*a(n-2)-a(n-4) for n > 3.
Sum_{i=0..n} a(i) = (2*n*(n+1)+(2*n+1)*(-1)^n-1)/16 (see A008805). (End)
a(n) = -a(-n) = A195034(n-1)-A195034(-n-1). - Bruno Berselli, Oct 12 2011
a(n) = A000326(n) - A191967(n). - Reinhard Zumkeller, Jul 07 2012
a(n) = Sum_{i=1..n} floor((2*i-n)/2). - Wesley Ivan Hurt, Aug 21 2014
a(n-1) = floor(n/2)*(n mod 2), where (n mod 2) is the parity of n, or remainder of division by 2. - M. F. Hasler, May 10 2015
a(n) = A158416(n) - 1. - Filip Zaludek, Oct 30 2016
E.g.f.: x*sinh(x)/2. - Ilya Gutkovskiy, Oct 30 2016
a(n) = A000007(a(n-1)) + a(n-2) for n > 1. - Nicolas Bělohoubek, Oct 06 2024

A003817 a(0) = 0, a(n) = a(n-1) OR n.

Original entry on oeis.org

0, 1, 3, 3, 7, 7, 7, 7, 15, 15, 15, 15, 15, 15, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63
Offset: 0

Views

Author

Keywords

Comments

Also, 0+1+2+...+n in lunar arithmetic in base 2 written in base 10. - N. J. A. Sloane, Oct 02 2010
For n>0: replace all 0's with 1's in binary representation of n. - Reinhard Zumkeller, Jul 14 2003

Crossrefs

This is Guy Steele's sequence GS(6, 6) (see A135416).
Cf. A167832, A167878. - Reinhard Zumkeller, Nov 14 2009
Cf. A179526; subsequence of A007448. - Reinhard Zumkeller, Jul 18 2010
Cf. A265705.

Programs

  • Haskell
    import Data.Bits ((.|.))
    a003817 n = if n == 0 then 0 else 2 * a053644 n - 1
    a003817_list = scanl (.|.) 0 [1..] :: [Integer]
    -- Reinhard Zumkeller, Dec 08 2012, Jan 15 2012
    
  • Maple
    A003817 := n -> n + Bits:-Nand(n, n):
    seq(A003817(n), n=0..61); # Peter Luschny, Sep 23 2019
  • Mathematica
    a[0] = 0; a[n_] := a[n] = BitOr[ a[n-1], n]; Table[a[n], {n, 0, 61}] (* Jean-François Alcover, Dec 19 2011 *)
    nxt[{n_,a_}]:={n+1,BitOr[a,n+1]}; Transpose[NestList[nxt,{0,0},70]] [[2]] (* Harvey P. Dale, May 06 2016 *)
    2^BitLength[Range[0,100]]-1 (* Paolo Xausa, Feb 08 2024 *)
  • PARI
    a(n)=1<<(log(2*n+1)\log(2))-1 \\ Charles R Greathouse IV, Dec 08 2011
    
  • Python
    def a(n): return 0 if n==0 else 1 + 2*a(int(n/2)) # Indranil Ghosh, Apr 28 2017
    
  • Python
    def A003817(n): return (1<Chai Wah Wu, Jul 17 2024

Formula

a(n) = a(n-1) + n*(1-floor(a(n-1)/n)). If 2^(k-1) <= n < 2^k, a(n) = 2^k - 1. - Benoit Cloitre, Aug 25 2002
a(n) = 1 + 2*a(floor(n/2)) for n > 0. - Benoit Cloitre, Apr 04 2003
G.f.: (1/(1-x)) * Sum_{k>=0} 2^k*x^2^k. - Ralf Stephan, Apr 18 2003
a(n) = 2*A053644(n)-1 = A092323(n) + A053644(n). - Reinhard Zumkeller, Feb 15 2004; corrected by Anthony Browne, Jun 26 2016
a(n) = OR{k OR (n-k): 0<=k<=n}. - Reinhard Zumkeller, Jul 15 2008
For n>0: a(n+1) = A035327(n) + n = A035327(n) XOR n. - Reinhard Zumkeller, Nov 14 2009
A092323(n+1) = floor(a(n)/2). - Reinhard Zumkeller, Jul 18 2010
a(n) = A265705(n,0) = A265705(n,n). - Reinhard Zumkeller, Dec 15 2015
a(n) = A062383(n) - 1.
G.f. A(x) satisfies: A(x) = 2*A(x^2)*(1 + x) + x/(1 - x). - Ilya Gutkovskiy, Aug 31 2019
a(n) >= A175039(n) - Austin Shapiro, Dec 29 2022

A142151 a(n) = OR{k XOR (n-k): 0<=k<=n}.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 6, 7, 14, 13, 14, 11, 14, 13, 14, 15, 30, 29, 30, 27, 30, 29, 30, 23, 30, 29, 30, 27, 30, 29, 30, 31, 62, 61, 62, 59, 62, 61, 62, 55, 62, 61, 62, 59, 62, 61, 62, 47, 62, 61, 62, 59, 62, 61, 62, 55, 62, 61, 62, 59, 62, 61, 62, 63, 126, 125, 126, 123, 126, 125
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 15 2008

Keywords

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor, (.|.))
    a142151 :: Integer -> Integer
    a142151 = foldl (.|.) 0 . zipWith xor [0..] . reverse . enumFromTo 1
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Julia
    using IntegerSequences
    A142151List(len) = [Bits("CIMP", n, n+1) for n in 0:len]
    println(A142151List(69))  # Peter Luschny, Sep 25 2021
    
  • Maple
    A142151 := n -> n + Bits:-Nor(n, n+1):
    seq(A142151(n), n=0..69); # Peter Luschny, Sep 26 2019
  • Python
    from functools import reduce
    from operator import or_
    def A142151(n): return 0 if n == 0 else reduce(or_,(k^n-k for k in range(n+1))) if n % 2 else (1 << n.bit_length()-1)-1 <<1 # Chai Wah Wu, Jun 30 2022

Formula

a(2*n) = 2*(A062383(n)-1);
A023416(a(n)) <= 1.

A142149 a(n) = XOR{k OR (n-k): 0<=k<=n}.

Original entry on oeis.org

0, 1, 3, 3, 6, 5, 5, 7, 12, 9, 15, 11, 10, 13, 9, 15, 24, 17, 27, 19, 30, 21, 29, 23, 20, 25, 23, 27, 18, 29, 17, 31, 48, 33, 51, 35, 54, 37, 53, 39, 60, 41, 63, 43, 58, 45, 57, 47, 40, 49, 43, 51, 46, 53, 45, 55, 36, 57, 39, 59, 34, 61, 33, 63, 96, 65, 99, 67, 102, 69, 101, 71
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 15 2008

Keywords

Comments

a(n) = XOR{k AND (n-k): 0<=k<=n}.

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor, (.|.))
    a142149 :: Integer -> Integer
    a142149 = foldl xor 0 . zipWith (.|.) [0..] . reverse . enumFromTo 1
    -- Reinhard Zumkeller, Mar 31 2015
    
  • PARI
    a(n)=if(n%2, n, bitxor(n, n/2)) \\ Charles R Greathouse IV, Jul 01 2022
  • Python
    def A142149(n): return n if n&1 else (n^ n>>1) # Chai Wah Wu, Jun 29 2022
    

Formula

a(2*n) = A048724(n) and a(2*n+1) = A005408(n).
Showing 1-5 of 5 results.