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.

A140253 a(2*n) = 2*(2*4^(n-1)-1) and a(2*n-1) = 2*4^(n-1)-1.

Original entry on oeis.org

-1, 1, 2, 7, 14, 31, 62, 127, 254, 511, 1022, 2047, 4094, 8191, 16382, 32767, 65534, 131071, 262142, 524287, 1048574, 2097151, 4194302, 8388607, 16777214, 33554431, 67108862, 134217727, 268435454, 536870911
Offset: 0

Views

Author

Paul Curtz, Jun 23 2008

Keywords

Comments

The inverse binomial transform is 1, 1, 4, -2, 10, -14, 34, -62 which leads to (-1)^(n+1)*A135440(n).
For n > 0: A266161(a(n)) = n and A266161(m) < n for m < a(n). - Reinhard Zumkeller, Dec 22 2015
Also, the decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 673", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Jul 23 2017

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a140253 n = a140253_list !! n
    a140253_list = -1 : concat
                        (transpose [a083420_list, map (* 2) a083420_list])
    -- Reinhard Zumkeller, Dec 22 2015
  • Maple
    A140253:=proc(n): if type(n, odd) then 2*4^(((n+1)/2)-1)-1 else 2*(2*4^((n/2)-1)-1) fi: end: seq(A140253(n),n=0..29); # Johannes W. Meijer, Jun 24 2011
  • Mathematica
    Table[(2^(n+1) - 3 + (-1)^(n+1))/2, {n, 0, 30}] (* Jean-François Alcover, Jun 05 2017 *)

Formula

a(2*n) = 2*A083420(n-1) and a(2*n+1) = A083420(n)
a(n+1) - a(n) = A014551(n); Jacobsthal-Lucas numbers.
a(2*n) + a(2*n+1) = 9*A002450(n)
a(n+1) - 2*a(n) = A010674(n+1); repeat 3, 0.
a(n) + A000034(n+1) = A000079(n); powers of 2.
a(n)= a(n-1) + 2*a(n-2) + 3. - Gary Detlefs, Jun 22 2010
a(n+1) = A000069(2^n); odious numbers. - Johannes W. Meijer, Jun 24 2011
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n>2, a(0) = -1, a(1) = 1, a(2) = 2. - Philippe Deléham, Feb 25 2012
G.f.: (x^2+3*x-1)/((1-2*x)*(1-x)*(1+x)). - Philippe Deléham, Feb 25 2012

Extensions

Edited, corrected and information added by Johannes W. Meijer, Jun 24 2011

A266089 Lexicographically smallest permutation of natural numbers such that in binary representation the number of ones of adjacent terms differ exactly by one.

Original entry on oeis.org

0, 1, 3, 2, 5, 4, 6, 7, 9, 8, 10, 11, 12, 13, 15, 14, 17, 16, 18, 19, 20, 21, 23, 22, 24, 25, 27, 26, 29, 28, 30, 31, 39, 35, 33, 32, 34, 37, 36, 38, 40, 41, 43, 42, 45, 44, 46, 47, 51, 49, 48, 50, 53, 52, 54, 55, 57, 56, 58, 59, 60, 61, 63, 62, 71, 67, 65
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 22 2015

Keywords

Examples

			.   n |  a(n) | A007088(a(n)) | A266161(n)
. ----+-------+---------------+------------
.   0 |    0  |            0  |         0
.   1 |    1  |            1  |         1
.   2 |    3  |           11  |         2
.   3 |    2  |           10  |         1
.   4 |    5  |          101  |         2
.   5 |    4  |          100  |         1
.   6 |    6  |          110  |         2
.   7 |    7  |          111  |         3
.   8 |    9  |         1001  |         2
.   9 |    8  |         1000  |         1
.  10 |   10  |         1010  |         2
.  11 |   11  |         1011  |         3
.  12 |   12  |         1100  |         2
.  13 |   13  |         1101  |         3
.  14 |   15  |         1111  |         4
.  15 |   14  |         1110  |         3
.  16 |   17  |        10001  |         2  .
		

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a266089 n = a266089_list !! n
    a266089_list = 0 : f 0 (zip [1..] $ tail a000120_list) where
       f x zws = g zws where
         g (yw@(y, w) : yws) | abs (x - w) /= 1 = g yws
                             | otherwise = y : f w (delete yw zws)
  • Mathematica
    a[0] = 0; a[n_] := a[n] = Module[{bw = DigitCount[a[n - 1], 2, 1], k = 1}, While[!FreeQ[Array[a, n - 1], k] || Abs[DigitCount[k, 2, 1] - bw] != 1, k++]; k]; Array[a, 100, 0] (* Amiram Eldar, Jul 18 2023 *)

Formula

A266161(n) = A000120(a(n)).
abs(A000120(a(n+1)) - A000120(a(n))) = abs(A266161(n+1) - A266161(n)) = 1.
Showing 1-2 of 2 results.