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

A081254 Numbers k such that A081252(m)/m^2 has a local maximum for m = k.

Original entry on oeis.org

1, 3, 6, 13, 26, 53, 106, 213, 426, 853, 1706, 3413, 6826, 13653, 27306, 54613, 109226, 218453, 436906, 873813, 1747626, 3495253, 6990506, 13981013, 27962026, 55924053, 111848106, 223696213, 447392426, 894784853, 1789569706, 3579139413
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local maxima, lim_{m->inf} A081252(m)/m^2 = 1/10. For local minima cf. A081253.
Row sums of the triangle A181971. - Reinhard Zumkeller, Jul 09 2012

Examples

			13 is a term since A081252(12)/12^2 = 15/144 = 0.104..., A081252(13)/13^2 = 18/169 = 0.106..., A081252(14)/14^2 = 20/196 = 0.102....
		

Crossrefs

Programs

  • Magma
    [Floor(2^(n-1)*5/3): n in [1..40]]; // Vincenzo Librandi, Apr 04 2012
    
  • Maple
    seq(floor(2^(n-1)*5/3),n=1..35); # Muniru A Asiru, Sep 20 2018
  • Mathematica
    Rest@CoefficientList[Series[-(x^2 - x - 1)*x/((x - 1)*(x + 1)*(2*x - 1)), {x, 0, 32}], x] (* Vincenzo Librandi, Apr 04 2012 *)
    a[n_]:=Floor[2^(n-1)*5/3]; Array[a,33,1] (* Stefano Spezia, Sep 01 2018 *)
  • PARI
    a(n) = 2^(n-1)*5\3; \\ Altug Alkan, Sep 21 2018

Formula

a(n) = floor(2^(n-1)*5/3). [corrected by Michel Marcus, Sep 21 2018]
a(n) = a(n-2) + 5*2^(n-3) for n > 2;
a(n+2) - a(n) = A020714(n-1);
a(n) + a(n-1) = A052549(n-1) for n > 1;
a(2*n+1) = A020989(n); a(2n) = A072197(n-1);
a(n+1) - a(n) = A048573(n-1).
G.f.: -(x^2 - x - 1)*x/((x - 1)*(x + 1)*(2*x - 1)).
a(n) = 5*2^(n-1)/3 + (-1)^n/6-1/2. a(n) = 2*a(n-1) + (1+(-1)^n)/2, a(1)=1. - Paul Barry, Mar 24 2003
a(2n) = 2*a(2*n-1) + 1, a(2*n+1) = 2*a(2*n), a(1)=1. a(n) = A000975(n-1) + 2^(n-1). - Philippe Deléham, Oct 15 2006
a(n) = A005578(n) + A000225(n-1). - Yuchun Ji, Sep 21 2018
a(n) - a(n-2) = 2 * (a(n-1) - a(n-3)), with a(0..2)=[1,3,6]. - Yuchun Ji, Mar 18 2020

A053646 Distance to nearest power of 2.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
Offset: 1

Views

Author

Henry Bottomley, Mar 22 2000

Keywords

Comments

Sum_{j=1..2^(k+1)} a(j) = A002450(k) = (4^k - 1)/3. - Klaus Brockhaus, Mar 17 2003

Examples

			a(10)=2 since 8 is closest power of 2 to 10 and |8-10| = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (h-> min(n-h, 2*h-n))(2^ilog2(n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 28 2021
  • Mathematica
    np2[n_]:=Module[{min=Floor[Log[2,n]],max},max=min+1;If[2^max-nHarvey P. Dale, Feb 21 2012 *)
  • PARI
    a(n)=vecmin(vector(n,i,abs(n-2^(i-1))))
    
  • PARI
    for(n=1,89,p=2^floor(0.1^25+log(n)/log(2)); print1(min(n-p,2*p-n),","))
    
  • PARI
    a(n) = my (p=#binary(n)); return (min(n-2^(p-1), 2^p-n)) \\ Rémy Sigrist, Mar 24 2018
    
  • Python
    def A053646(n): return min(n-(m := 2**(len(bin(n))-3)),2*m-n) # Chai Wah Wu, Mar 08 2022

Formula

a(2^k+i) = i for 1 <= i <= 2^(k-1); a(3*2^k+i) = 2^k-i for 1 <= i <= 2^k; (Sum_{k=1..n} a(k))/n^2 is bounded. - Benoit Cloitre, Aug 17 2002
a(n) = min(n-2^floor(log(n)/log(2)), 2*2^floor(log(n)/log(2))-n). - Klaus Brockhaus, Mar 08 2003
From Peter Bala, Aug 04 2022: (Start)
a(n) = a( 1 + floor((n-1)/2) ) + a( ceiling((n-1)/2) ).
a(2*n) = 2*a(n); a(2*n+1) = a(n) + a(n+1) for n >= 2. Cf. A006165. (End)
a(n) = 2*A006165(n) - n for n >= 2. - Peter Bala, Sep 25 2022

A206374 a(n) = (7*4^n - 1)/3.

Original entry on oeis.org

2, 9, 37, 149, 597, 2389, 9557, 38229, 152917, 611669, 2446677, 9786709, 39146837, 156587349, 626349397, 2505397589, 10021590357, 40086361429, 160345445717, 641381782869, 2565527131477, 10262108525909, 41048434103637, 164193736414549, 656774945658197
Offset: 0

Views

Author

Brad Clardy, Feb 07 2012

Keywords

Comments

First bisection of A062092 and A081253, second bisection of A097163. - Bruno Berselli, Feb 12 2012
Except a(0)=2, this is the 3rd row of table A178415. - Michel Marcus, Apr 13 2015

Crossrefs

Cf. A002450, A006666, A072197; A002042 (first differences), A178415, A347834.

Programs

  • Magma
    [(7*4^n-1)/3 : n in [0..30]];
    
  • Mathematica
    Table[(7(4^n) - 1)/3, {n, 0, 24}] (* Alonso del Arte, Feb 11 2012 *)
    CoefficientList[Series[(2-x)/(1-5*x+4*x^2),{x,0,30}],x] (* or *) LinearRecurrence[{5,-4},{2,9},30] (* Vincenzo Librandi, Mar 20 2012 *)
  • PARI
    vector(20,n,(7*4^(n-1)-1)/3) \\ Derek Orr, Apr 12 2015

Formula

G.f.: (2-x)/(1-5*x+4*x^2). - Bruno Berselli, Feb 12 2012
a(n) = A083597(n)+1. - Bruno Berselli, Feb 12 2012
a(n) = 4*a(n-1)+1 for n>0, a(0)=2. - Bruno Berselli, Oct 22 2015
a(n) = 7*A002450(n) + 2. - Yosu Yurramendi, Jan 24 2017
A006666(a(n)) = 2*n+11 for n > 0. - Juan Miguel Barga Pérez, Jun 18 2020
a(n) = 5*a(n-1) - 4*a(n-2) for n >= 2. - Wesley Ivan Hurt, Jun 30 2020
a(n) = A178415(3, n) = A347834(4, n-1), arrays, for n >= 1.- Wolfdieter Lang, Nov 29 2021

A081252 Partial sums of A053646.

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 5, 5, 6, 8, 11, 15, 18, 20, 21, 21, 22, 24, 27, 31, 36, 42, 49, 57, 64, 70, 75, 79, 82, 84, 85, 85, 86, 88, 91, 95, 100, 106, 113, 121, 130, 140, 151, 163, 176, 190, 205, 221, 236, 250, 263, 275, 286, 296, 305, 313, 320, 326, 331, 335, 338, 340, 341, 341
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Examples

			First seven terms of A053646 are 0,0,1,0,1,2,1, so a(7) = 5.
		

Crossrefs

Programs

  • PARI
    {s=0; for(n=1,65,p=2^floor(0.1^25+log(n)/log(2)); print1(s=s+min(n-p,2*p-n),","))}

Formula

a(n) = sum{j=1..n, A053646(j)}.

A266071 Binary representation of the middle column of the "Rule 3" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 10, 100, 1001, 10010, 100101, 1001010, 10010101, 100101010, 1001010101, 10010101010, 100101010101, 1001010101010, 10010101010101, 100101010101010, 1001010101010101, 10010101010101010, 100101010101010101, 1001010101010101010, 10010101010101010101
Offset: 0

Views

Author

Robert Price, Dec 20 2015

Keywords

Examples

			From _Michael De Vlieger_, Dec 21 2015: (Start)
First 8 rows at left with the center column values in parentheses, and at right the binary value of center column cells up to that row:
              (1)               ->         1
            1 (0) 0             ->        10
          0 0 (0) 1 0           ->       100
        1 1 1 (1) 0 0 1         ->      1001
      0 0 0 0 (0) 0 1 0 0       ->     10010
    1 1 1 1 1 (1) 1 0 0 1 1     ->    100101
  0 0 0 0 0 0 (0) 0 0 1 0 0 0   ->   1001010
1 1 1 1 1 1 1 (1) 1 1 0 0 1 1 1 ->  10010101
(End)
		

References

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

Crossrefs

Cf. A266070, A081253 (decimal).

Programs

  • Mathematica
    Table[SeriesCoefficient[(1 - x^2 + x^3)/(1 - 10 x - x^2 + 10 x^3), {x, 0, n}], {n, 0, 19}] (* Michael De Vlieger, Dec 21 2015 *)
  • Python
    print([991*10**n//990 for n in range(50)]) # Karl V. Keller, Jr., Oct 09 2021

Formula

G.f.: (1 - x^2 + x^3)/(1 - 10*x - x^2 + 10*x^3). - Michael De Vlieger, Dec 21 2015
a(n) = floor(991*10^n/990). - Karl V. Keller, Jr., Oct 09 2021

A266613 Decimal representation of the middle column of the "Rule 41" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 2, 5, 10, 20, 41, 82, 165, 330, 661, 1322, 2645, 5290, 10581, 21162, 42325, 84650, 169301, 338602, 677205, 1354410, 2708821, 5417642, 10835285, 21670570, 43341141, 86682282, 173364565, 346729130, 693458261, 1386916522, 2773833045, 5547666090, 11095332181
Offset: 0

Views

Author

Robert Price, Jan 01 2016

Keywords

Crossrefs

Programs

  • Maple
    # Rule 41: value in generation r and column c, where c=0 is the central one
    r41 := proc(r::integer,c::integer)
        option remember;
        local up ;
        if r = 0 then
            if c = 0 then
                1;
            else
                0;
            end if;
        else
            # previous 3 bits
            [procname(r-1,c+1),procname(r-1,c),procname(r-1,c-1)] ;
            up := op(3,%)+2*op(2,%)+4*op(1,%) ;
            # rule 41 = 00101001_2: {5,3,0}->1, all others ->0
            if up in {5,3,0} then
                1;
            else
                0 ;
            end if;
        end if;
    end proc:
    A266613 := proc(n)
        b := [seq(r41(r,0),r=0..n)] ;
        add(op(-i,b)*2^(i-1),i=1..nops(b)) ;
    end proc:
    smax := 20 ;
    L := [seq(A266613(n),n=0..smax)] ; # R. J. Mathar, Apr 12 2019
  • Mathematica
    rule=41; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) mc=Table[catri[[k]][[k]],{k,1,rows}]; (* Keep only middle cell from each row *) Table[FromDigits[Take[mc,k],2],{k,1,rows}] (* Binary Representation of Middle Column *)

Formula

A266612(n) = A007088(a(n)).
Conjectures from Colin Barker, Jan 02 2016 and Apr 16 2019: (Start)
a(n) = (31*2^n-4*((-1)^n+3))/24 for n>2.
a(n) = 2*a(n-1)+a(n-2)-2*a(n-3) for n>5. - [corrected by Karl V. Keller, Jr., Oct 07 2021]
G.f.: (1-x^4+x^5) / ((1-x)*(1+x)*(1-2*x)). (End)
Conjecture: a(n) = A000975(n) + 20*2^(n-5), for n>2. - Andres Cicuttin, Mar 31 2016

Extensions

Removed an unjustified claim that Colin Barker's conjectures are correct. Removed a program based on a conjecture. - N. J. A. Sloane, Jun 13 2022

A191665 Dispersion of A042963 (numbers >1, congruent to 1 or 2 mod 4), by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 6, 4, 10, 13, 9, 7, 21, 26, 18, 14, 8, 42, 53, 37, 29, 17, 11, 85, 106, 74, 58, 34, 22, 12, 170, 213, 149, 117, 69, 45, 25, 15, 341, 426, 298, 234, 138, 90, 50, 30, 16, 682, 853, 597, 469, 277, 181, 101, 61, 33, 19, 1365, 1706, 1194, 938, 554
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A000975
Row 2: A081254
Row 3: A081253
Row 4: A052997
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191663=dispersion of A042948 (0 or 1 mod 4 and >1)
A054582=dispersion of A005843 (0 or 2 mod 4 and >1; evens)
A191664=dispersion of A014601 (0 or 3 mod 4 and >1)
A191665=dispersion of A042963 (1 or 2 mod 4 and >1)
A191448=dispersion of A005408 (1 or 3 mod 4 and >1, odds)
A191666=dispersion of A042964 (2 or 3 mod 4)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191663 has 1st col A042964, all else A042948
A054582 has 1st col A005408, all else A005843
A191664 has 1st col A042963, all else A014601
A191665 has 1st col A014601, all else A042963
A191448 has 1st col A005843, all else A005408
A191666 has 1st col A042948, all else A042964
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.

Examples

			Northwest corner:
1...2...5....10...21
3...6...13...26...53
4...9...18...37...74
7...14..29...58...117
8...17..34...69...138
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 2; b = 5; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A042963: (2+4k,5+4k) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]]
    (* A191665 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]]
    (* A191665  *)

A266069 Decimal representation of the n-th iteration of the "Rule 3" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 4, 2, 121, 4, 2035, 8, 32743, 16, 524239, 32, 8388511, 64, 134217535, 128, 2147483263, 256, 34359737599, 512, 549755812351, 1024, 8796093019135, 2048, 140737488349183, 4096, 2251799813672959, 8192, 36028797018939391, 16384, 576460752303374335, 32768
Offset: 0

Views

Author

Robert Price, Dec 20 2015

Keywords

Comments

Rule 35 also generates this sequence.

Examples

			From _Michael De Vlieger_, Dec 21 2015: (Start)
First 8 rows, replacing leading zeros with ".", the row converted to its binary, then decimal equivalent at right:
              1                =               1 ->     1
            1 0 0              =             100 ->     4
          . . . 1 0            =              10 ->     2
        1 1 1 1 0 0 1          =         1111001 ->   121
      . . . . . . 1 0 0        =             100 ->     4
    1 1 1 1 1 1 1 0 0 1 1      =     11111110011 ->  2035
  . . . . . . . . . 1 0 0 0    =            1000 ->     8
1 1 1 1 1 1 1 1 1 1 0 0 1 1 1  = 111111111100111 -> 32743
(End)
		

References

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

Crossrefs

Programs

  • Mathematica
    rule = 3; rows = 30; Table[FromDigits[Table[Take[CellularAutomaton[rule,{{1},0}, rows-1, {All,All}][[k]], {rows-k+1, rows+k-1}], {k,1,rows}][[k]],2], {k,1,rows}]
  • Python
    print([2*4**n - 3*2**((n-1)//2) - 1 if n%2 else 2**(n//2) for n in range(30)]) # Karl V. Keller, Jr., Aug 25 2021

Formula

G.f.: (1+4*x-17*x^2+45*x^3+16*x^4-64*x^5) / ((1-x)*(1+x)*(1-4*x)*(1+4*x)*(1-2*x^2)). - Colin Barker, Dec 21 2015 and Apr 18 2019
a(n) = 2*4^n - 3*2^((n-1)/2) - 1 for odd n; a(n) = 2^(n/2) for even n. - Karl V. Keller, Jr., Aug 25 2021

A266255 Decimal representation of the n-th iteration of the "Rule 11" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

1, 4, 3, 124, 3, 2044, 3, 32764, 3, 524284, 3, 8388604, 3, 134217724, 3, 2147483644, 3, 34359738364, 3, 549755813884, 3, 8796093022204, 3, 140737488355324, 3, 2251799813685244, 3, 36028797018963964, 3, 576460752303423484, 3, 9223372036854775804, 3
Offset: 0

Views

Author

Robert Price, Dec 25 2015

Keywords

Comments

Rule 43 also generates this sequence.

References

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

Crossrefs

Programs

  • Mathematica
    rule=11; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) Table[FromDigits[catri[[k]],2],{k,1,rows}]   (* Decimal Representation of Rows *)
  • Python
    print([2*4**n - 4 if n%2 else 3 - 2*0**n for n in range(33)]) # Karl V. Keller, Jr., Aug 26 2021

Formula

From Colin Barker, Dec 27 2015 and Apr 14 2019: (Start)
a(n) = (7*(-1)^n+2^(2*n+1)-(-1)^n*2^(2*n+1)-1)/2 for n>0.
a(n) = 17*a(n-2)-16*a(n-4) for n>4.
G.f.: (1+4*x-14*x^2+56*x^3-32*x^4) / ((1-x)*(1+x)*(1-4*x)*(1+4*x)).
(End)
a(n) = 2*4^n - 4 for odd n; a(n) = 3 - 2*0^n for even n. - Karl V. Keller, Jr., Aug 26 2021

A294523 Lexicographically earliest sequence of positive terms, such that, for any n > 0, the binary expansion of n, say of size k+1, is (1, a(n) mod 2, a^2(n) mod 2, ..., a^k(n) mod 2) (where a^i denotes the i-th iterate of the sequence).

Original entry on oeis.org

1, 2, 1, 2, 6, 5, 1, 2, 10, 6, 14, 9, 5, 13, 1, 2, 18, 10, 22, 12, 6, 14, 30, 17, 9, 5, 11, 25, 13, 29, 1, 2, 34, 18, 38, 20, 10, 22, 46, 24, 12, 6, 54, 28, 14, 30, 62, 33, 17, 9, 19, 41, 5, 11, 23, 49, 25, 13, 27, 57, 29, 61, 1, 2, 66, 34, 70, 36, 18, 38, 78
Offset: 1

Views

Author

Rémy Sigrist, Nov 01 2017

Keywords

Comments

More informally, the parity of the iterate of the sequence at n gives the binary expansion of n (beyond the leading 1).
Apparently, iterating the sequence always leads to one of these three loops:
- the fixed point (1) iff we start from 2^k-1 for some k > 0,
- the fixed point (2) iff we start from 2^k for some k > 0,
- or (5, 6) for any other starting value.
a(n) is even iff n belongs to A004754.
a(n) is odd iff n belongs to A004760.
If a(n) > n then a(n) = A080541(n).
If n < 2^k then a(n) < 2^k.
Apparently, if a(n) > 2, then A054429(a(n)) = a(A054429(n)); this accounts for the symmetry of the part connected to the loop (5,6) in the oriented graph of this sequence.

Examples

			For n=11:
- the binary representation of 11 is (1,0,1,1),
- a(11) = 14 has parity 0,
- a(14) = 13 has parity 1,
- a(13) = 5 has parity 1,
- we find the binary digits of 11 beyond the initial 1, in order: 0, 1, 1.
See also representations of first terms in Links section.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 1 iff n = A000225(k) for some k > 0.
a(n) = 2 iff n = A000079(k) for some k > 0.
a(n) = 5 iff n = A081254(k) for some k > 2.
a(n) = 6 iff n = A000975(k) for some k > 2.
a(n) = 10 iff n = A081253(k) for some k > 2.
a(n) = 12 iff n = A266613(k) for some k > 3.
a(n) = 13 iff n = A052997(k) for some k > 2.
a(n) = 14 iff n = A266721(k) for some k > 2.
a(n) = 18 iff n = A267045(k) for some k > 3.
a(n) = 54 iff n = A266248(k) for some k > 4.
These formulas come from the fact that each sequence on the right side, say f, eventually satisfies: f(n) = floor(f(n+1)/2), and f(n) and f(n+2) have the same parity.
Showing 1-10 of 10 results.