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 14 results. Next

A245537 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=A083424(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case a(2^k-2^r+j)=A083424(k-r-1)*a(j).

Original entry on oeis.org

1, 1, 3, 1, 1, 3, 14, 1, 1, 1, 3, 3, 3, 14, 52, 1, 1, 1, 3, 1, 1, 3, 14, 3, 3, 3, 9, 14, 14, 52, 216, 1, 1, 1, 3, 1, 1, 3, 14, 1, 1, 1, 3, 3, 3, 14, 52, 3, 3, 3, 9, 3, 3, 9, 42, 14, 14, 14, 42, 52, 52, 216, 848, 1, 1, 1, 3, 1, 1, 3, 14, 1, 1, 1, 3, 3, 3, 14, 52
Offset: 1

Views

Author

N. J. A. Sloane, Jul 26 2014

Keywords

Comments

Similar to A245180, except the multiplier 8 in that recurrence is set here to be 1.
See A245196 for a list of other sequences produced by this type of recurrence.

Examples

			Arranged into blocks:
1,
1, 3,
1, 1, 3, 14,
1, 1, 1, 3, 3, 3, 14, 52,
1, 1, 1, 3, 1, 1, 3, 14, 3, 3, 3, 9, 14, 14, 52, 216,
1, 1, 1, 3, 1, 1, 3, 14, 1, 1, 1, 3, 3, 3, 14, 52, 3, 3, 3, 9, 3, 3, 9, 42, 14, 14, 14, 42, 52, 52, 216, 848,
...
		

Crossrefs

A245538 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=A083424(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case a(2^k-2^r+j)=2*A083424(k-r-1)*a(j).

Original entry on oeis.org

1, 1, 3, 1, 2, 3, 14, 1, 2, 2, 6, 3, 6, 14, 52, 1, 2, 2, 6, 2, 4, 6, 28, 3, 6, 6, 18, 14, 28, 52, 216, 1, 2, 2, 6, 2, 4, 6, 28, 2, 4, 4, 12, 6, 12, 28, 104, 3, 6, 6, 18, 6, 12, 18, 84, 14, 28, 28, 84, 52, 104, 216, 848, 1, 2, 2, 6, 2, 4, 6, 28, 2, 4, 4, 12, 6, 12, 28, 104
Offset: 1

Views

Author

N. J. A. Sloane, Jul 26 2014

Keywords

Comments

Similar to A245180, except the multiplier 8 in that recurrence is set here to be 2.
See A245196 for a list of other sequences produced by this type of recurrence.

Examples

			Arranged into blocks:
1,
1, 3,
1, 2, 3, 14,
1, 2, 2, 6, 3, 6, 14, 52,
1, 2, 2, 6, 2, 4, 6, 28, 3, 6, 6, 18, 14, 28, 52, 216,
1, 2, 2, 6, 2, 4, 6, 28, 2, 4, 4, 12, 6, 12, 28, 104, 3, 6, 6, 18, 6, 12, 18, 84, 14, 28, 28, 84, 52, 104, 216, 848,
...
		

Crossrefs

A245539 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=A083424(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case a(2^k-2^r+j)=4*A083424(k-r-1)*a(j).

Original entry on oeis.org

1, 1, 3, 1, 4, 3, 14, 1, 4, 4, 12, 3, 12, 14, 52, 1, 4, 4, 12, 4, 16, 12, 56, 3, 12, 12, 36, 14, 56, 52, 216, 1, 4, 4, 12, 4, 16, 12, 56, 4, 16, 16, 48, 12, 48, 56, 208, 3, 12, 12, 36, 12, 48, 36, 168, 14, 56, 56, 168, 52, 208, 216, 848
Offset: 1

Views

Author

N. J. A. Sloane, Jul 26 2014

Keywords

Comments

Similar to A245180, except the multiplier 8 in that recurrence is set here to be 4.
See A245196 for a list of other sequences produced by this type of recurrence.

Examples

			Arranged into blocks:
1,
1, 3,
1, 4, 3, 14,
1, 4, 4, 12, 3, 12, 14, 52,
1, 4, 4, 12, 4, 16, 12, 56, 3, 12, 12, 36, 14, 56, 52, 216,
1, 4, 4, 12, 4, 16, 12, 56, 4, 16, 16, 48, 12, 48, 56, 208, 3, 12, 12, 36, 12, 48, 36, 168, 14, 56, 56, 168, 52, 208, 216, 848,
...
		

Crossrefs

A160239 Number of "ON" cells in a 2-dimensional cellular automaton ("Fredkin's Replicator") evolving according to the rule that a cell is ON in a given generation if and only if there was an odd number of ON cells among the eight nearest neighbors in the preceding generation, starting with one ON cell.

Original entry on oeis.org

1, 8, 8, 24, 8, 64, 24, 112, 8, 64, 64, 192, 24, 192, 112, 416, 8, 64, 64, 192, 64, 512, 192, 896, 24, 192, 192, 576, 112, 896, 416, 1728, 8, 64, 64, 192, 64, 512, 192, 896, 64, 512, 512, 1536, 192, 1536, 896, 3328, 24, 192, 192, 576, 192, 1536, 576, 2688, 112, 896, 896, 2688, 416, 3328, 1728, 6784
Offset: 0

Views

Author

John W. Layman, May 05 2009

Keywords

Comments

This is the odd-rule cellular automaton defined by OddRule 757 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link). - N. J. A. Sloane, Feb 25 2015
The partial sums are in A245542, in which the structure also looks like an irregular stepped pyramid. - Omar E. Pol, Jan 29 2015

Examples

			From _Omar E. Pol_, Jul 22 2014 (Start):
Written as an irregular triangle in which row lengths is A011782 the sequence begins:
1;
8;
8, 24;
8, 64, 24, 112;
8, 64, 64, 192, 24, 192, 112, 416;
8, 64, 64, 192, 64, 512, 192, 896, 24, 192, 192, 576, 112, 896, 416, 1728;
8, 64, 64, 192, 64, 512, 192, 896, 64, 512, 512, 1536, 192, 1536, 896, 3328, 24, 192, 192, 576, 192, 1536, 576, 2688, 112, 896, 896, 2688, 416, 3328, 1728, 6784;
(End)
Right border gives A246030. - _Omar E. Pol_, Jan 29 2015 [This is simply a restatement of the theorem that this sequence is the Run Length Transform of A246030. - _N. J. A. Sloane_, Jan 29 2015]
.
From _Omar E. Pol_, Mar 18 2015 (Start):
Also, the sequence can be written as an irregular tetrahedron as shown below:
1;
..
8;
..
8;
24;
.........
8,    64;
24;
112;
...................
8,    64,  64, 192;
24,  192;
112;
416;
.....................................
8,    64,  64, 192, 64, 512,192, 896;
24,  192, 192, 576;
112, 896;
416;
1728;
.......................................................................
8,    64,  64, 192, 64, 512,192, 896,64,512,512,1536,192,1536,896,3328;
24,  192, 192, 576,192,1536,576,2688;
112, 896, 896,2688;
416,3328;
1728;
6784;
...
Apart from the initial 1, we have that T(s,r,k) = T(s+1,r,k). On the other hand, it appears that the configuration of ON cells of T(s,r,k) is also the central part of the configuration of ON cells of T(s+1,r+1,k).
(End)
		

Crossrefs

Cf. A122108, A147562, A164032, A245180 (gives a(n)/8, n>=2).
Cf. also A245542 (Partial sums), A245543, A083424, A245562, A246030, A254731 (an "even-rule" version).

Programs

  • Haskell
    import Data.List (transpose)
    a160239 n = a160239_list !! n
    a160239_list = 1 : (concat $
       transpose [a8, hs, zipWith (+) (map (* 2) hs) a8, tail a160239_list])
       where a8 = map (* 8) a160239_list;
             hs = h a160239_list; h (_:x:xs) = x : h xs
    -- Reinhard Zumkeller, Feb 13 2015
    
  • Maple
    # From N. J. A. Sloane, Jan 19 2015:
    f:=proc(n) option remember;
    if n=0 then RETURN(1);
    elif n mod 2 = 0 then RETURN(f(n/2))
    elif n mod 4 = 1 then RETURN(8*f((n-1)/4))
    else RETURN(f(n-2)+2*f((n-1)/2)); fi;
    end;
    [seq(f(n),n=0..255)];
  • Mathematica
    A160239[n_] :=
    CellularAutomaton[{52428, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}}, {{{1}}, 0}, {{n}}][[1]] // Total@*Total (* Charles R Greathouse IV, Aug 21 2014 *)
    ArrayPlot /@ CellularAutomaton[{52428, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}}, {{{1}}, 0}, 30] (* Charles R Greathouse IV, Aug 21 2014 *)
  • PARI
    A160239=[];a(n)={if(n>#A160239,A160239=concat(A160239,vector(n-#A160239)),n||return(1);A160239[n]&&return(A160239[n]));A160239[n]=if(bittest(n,0),if(bittest(n,1),a(n-2)+2*a(n\2),a(n\4)*8),a(n\2))} \\ M. F. Hasler, May 10 2016

Formula

a(0) = 1; a(2t)=a(t), a(4t+1)=8*a(t), a(4t+3)=2*a(2t+1)+8*a(t) for t >= 0. (Conjectured by Hrothgar, Jul 11 2014; proved by N. J. A. Sloane, Oct 04 2014.)
For n >= 2, a(n) = 8^r * Product_{lengths i of runs of 1 in binary expansion of n} R(i), where r is the number of runs of 1 in the binary expansion of n and R(i) = A083424(i-1) = (5*4^(i-1)+(-2)^(i-1))/6. Note that row i of the table in A245562 lists the lengths of runs of 1 in binary expansion of i. Example: n=7 = 111 in binary, so r=1, i=3, R(3) = A083424(2) = 14, and so a(7) = 8^1*14 = 112. That is, this sequence is the Run Length Transform of A246030. - N. J. A. Sloane, Oct 04 2014
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product). - N. J. A. Sloane, Aug 25 2014

Extensions

Offset changed to 1 by Hrothgar, Jul 11 2014
Offset reverted to 0 by N. J. A. Sloane, Jan 19 2015

A179596 Eight white kings and one red king on a 3 X 3 chessboard. G.f.: (1 + x)/(1 - 2*x - 11*x^2 - 6*x^3).

Original entry on oeis.org

1, 3, 17, 73, 351, 1607, 7513, 34809, 161903, 751783, 3493353, 16227737, 75393055, 350251335, 1627192697, 7559508409, 35119644495, 163157037671, 757987215241, 3521419711833, 16359641017343, 76002822156295, 353090213774361
Offset: 0

Views

Author

Johannes W. Meijer, Jul 28 2010; edited Jun 21 2013

Keywords

Comments

The a(n) represent the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the center square the king goes crazy and turns into a red king.
On a 3 X 3 chessboard there are 2^9 = 512 ways to go crazy on the center square (off the center the piece behaves like a normal king). The red king is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 red kings lead to 47 different red king sequences, see the overview of the red king sequences.
The sequence above corresponds to four A[5] vectors with decimal [binary] values 367 [101 101 111], 463 [111 001 111], 487 [111 100 111] and 493 [111 101 101]. These vectors lead for the side squares to A126473 and for the central square to A179597.
This sequence belongs to a family of sequences with g.f. (1+x)/(1 - 2*x - (k+8)*x^2 - 2*k*x^3). Red king sequences that are members of this family are A083424 (k=0), A179604 (k=1), A179600 (k=2), A179596 (k=3; this sequence) and A086346 (k=4). Other members of this family are A015528 (k=5) and A179608 (k=-4).

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.

Crossrefs

Cf. A180140 (berserker sequences).
Cf. Red king sequences corner squares [decimal value A[5]]: A086346 [495], A015525 [239], A179596 [367], A179600 [335], A015524 [95], A083858 [31], A179604 [327], A015523 [27], A179610 [85], A083424 [325], A015521 [11], A007482 [2], A014335 [16].

Programs

  • Maple
    nmax:=22; m:=1; A[1]:= [0,1,0,1,1,0,0,0,0]: A[2]:= [1,0,1,1,1,1,0,0,0]: A[3]:= [0,1,0,0,1,1,0,0,0]: A[4]:=[1,1,0,0,1,0,1,1,0]: A[5]:= [1,0,1,1,0,1,1,1,1]: A[6]:= [0,1,1,0,1,0,0,1,1]: A[7]:= [0,0,0,1,1,0,0,1,0]: A[8]:= [0,0,0,1,1,1,1,0,1]: A[9]:= [0,0,0,0,1,1,0,1,0]: A:=Matrix([A[1],A[2],A[3],A[4],A[5], A[6],A[7],A[8],A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{2,11,6},{1,3,17},30] (* Harvey P. Dale, May 18 2011 *)
  • PARI
    Vec((1+x)/(1-2*x-11*x^2-6*x^3)+O(x^99)) \\ Charles R Greathouse IV, Jul 16 2011

Formula

G.f.: (1+x)/(1 - 2*x - 11*x^2 - 6*x^3).
a(n) = 2*a(n-1) + 11*a(n-2) + 6*a(n-3) with a(0)=1, a(1)=3 and a(2)=17.
a(n) = (-1)^(-n)*2^(n+1)/9 + ((49+17*sqrt(7))*A^(-n) + (49-17*sqrt(7))*B^(-n))/126 with A = (-2+sqrt(7))/3 and B = (-2-sqrt(7))/3.
Lim_{k->infinity} a(n+k)/a(k) = (-1)^(n+1)*A000244(n)/(A015530(n)*sqrt(7) - A108851(n)).

A245180 A160239(n)/8.

Original entry on oeis.org

1, 1, 3, 1, 8, 3, 14, 1, 8, 8, 24, 3, 24, 14, 52, 1, 8, 8, 24, 8, 64, 24, 112, 3, 24, 24, 72, 14, 112, 52, 216, 1, 8, 8, 24, 8, 64, 24, 112, 8, 64, 64, 192, 24, 192, 112, 416, 3, 24, 24, 72, 24, 192, 72, 336, 14, 112, 112, 336, 52, 416, 216, 848, 1, 8, 8, 24, 8, 64, 24, 112, 8, 64, 64, 192
Offset: 1

Views

Author

N. J. A. Sloane, Jul 16 2014

Keywords

Examples

			The entries may be arranged into blocks of sizes 1,2,4,8,...:
B_0: 1,
B_1: 1, 3,
B_2: 1, 8, 3, 14,
B_3: 1, 8, 8, 24, 3, 24, 14, 52,
B_4: 1, 8, 8, 24, 8, 64, 24, 112, 3, 24, 24, 72, 14, 112, 52, 216,
B_5: 1, 8, 8, 24, 8, 64, 24, 112, 8, 64, 64, 192, 24, 192, 112, 416, 3, 24, 24, 72, 24, 192, 72, 336, 14, 112, 112, 336, 52, 416, 216, 848,
...
The first half of each block is equal to 1 followed by 8 times an initial segment of the sequence itself.
The next quarter of each block consists of 3 times (1 followed by 8 times an initial segment of the sequence itself).
The next one-eighth of each block consists of 14 times (1 followed by 8 times an initial segment of the sequence itself).
And so on, the successive multipliers 1,3,14,52,... being given by A083424.
Also, the final quarter of any block consists of the twice the last half of the previous block added to eight times the full block before that.
Consider for example the 4th block,
[1, 8, 8, 24, 8, 64, 24, 112; 3, 24, 24, 72; 14, 112, 52, 216].
This is [1 8*(1,1,3,1,8,3,14); 3*(1 8*(1,1,3)); 2*(3,24,14,52)+8*(1,8,3,14)].
The final entries in the blocks give A083424.
See also the formula section.
.
From _Omar E. Pol_, Mar 18 2015: (Start)
Also, the sequence can be written as an irregular tetrahedron T(s,r,k) as shown below:
1;
..
1;
3;
........
1,    8;
3;
14;
................
1,    8,  8, 24;
3,   24;
14;
52;
..................................
1,    8,  8, 24,  8,  64, 24, 112;
3,   24, 24, 72;
14, 112;
52;
216;
.....................................................................
1,    8,  8, 24,  8,  64, 24, 112, 8, 64, 64, 192, 24, 192, 112, 416;
3,   24, 24, 72, 24, 192, 72, 336;
14, 112,112,336;
52, 416;
216;
848;
...
Note that T(s,r,k) = T(s+1,r,k).
(End)
		

Crossrefs

See A245181 for the numbers that appear.

Programs

  • Haskell
    a245180 = flip div 8 . a160239  -- Reinhard Zumkeller, Feb 13 2015
  • Maple
    R:=proc(n) option remember;
    if n=1 then 1
    elif (n mod 2) = 0 then R(n/2)
    elif (n mod 4) = 3 then 2*R((n-1)/2)+R(n-2)
    else 8*R((n-1)/4); fi; end;
    [seq(R(n),n=1..200)];
  • Mathematica
    R[n_] := R[n] = Which[n == 1, 1, Mod[n, 2] == 0, R[n/2], Mod[n, 4] == 3, 2*R[(n - 1)/2] + R[n - 2], True, 8*R[(n - 1)/4] ];
    Array[R, 200] (* Jean-François Alcover, Nov 16 2017, translated from Maple *)

Formula

The following is a fairly simple explicit formula for a(n) as a function of n: a(n) = 8^(r-1) * Product_{lengths i of runs of 1 in binary expansion of n} R(i), where r is the number of runs of 1 in the binary expansion of n and R(i) = A083424(i-1) = (5*4^(i-1)+(-2)^(i-1))/6. Note that row i of the table in A245562 lists the lengths of runs of 1 in binary expansion of i. Example: n = 27 = 11011 in binary, there are two runs each of length 2, so r=1, R(2) = A083424(1) = 3, and so a(27) = 8^1*3*3 = 72. - N. J. A. Sloane, Aug 10 2014
Many 2-D cellular automata studied in the Toothpick paper (Applegate et al.) have a recursive formula for the general term in a typical block of 2^k terms (see Equations 2, 4, 5, 9, 10 12, 38, 39 of that paper). An analogous formula for the present sequence is the following.
Consider the block B_{k-1} containing terms a(2^(k-1)), a(2^(k-1)+1), ..., a(2^k-1). It is convenient to index the terms working backwards from the next, 2^k-th, term. For n in the range 2^(k-1) <= n < 2^k, write n = 2^k-2^r+j, with 0 <= r <= k-1 and 0 <= j < 2^(r-1), and j=0 if r=0. Then
(if j=0) a(2^k-2^r) = f(k-r-1),
(if j>0) a(2^k-2^r+j) = 8*f(k-r-1)*a(j),
where f(i) = A083424(i) = (5*4^i+(-2)^i)/6.
For example, here is block B_4, consisting of terms a(16)=a(31), so k=5:
n: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
a(n): 1 8 8 24 8 64 24 112 3 24 24 72 14 112 52 216
r: 4 4 4 4 4 4 4 4 3 3 3 3 2 2 1 0
j: 0 1 2 3 4 5 6 7 0 1 2 3 0 1 0 0
Then we have a(24) = a(32-8) = f(5-3-1) = f(1) = 3, illustrating the first equation, and a(21) = a(32-16+5) = 8*f(0)*a(5) = 8*1*8 = 64, illustrating the second equation.
See A245196 for a list of sequences produced by this type of recurrence.

A245196 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=wt(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case a(2^k-2^r+j)=a(j)*wt(k-r-1) (where wt(i) = A000120(i)).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 25 2014

Keywords

Comments

Other sequences defined by a recurrence of this class (see the Formula and Maple sections) include A245180, A245195, A048896, A245536, A038374.

Examples

			May be arranged into blocks of lengths 1,2,4,8,...:
0,
0, 1,
0, 0, 1, 1,
0, 0, 0, 0, 1, 0, 1, 2,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 2, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 2, 0, 1, 2,
...
		

Crossrefs

Programs

  • Maple
    Maple code for this sequence:
    wt := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
    G:=[seq(wt(n),n=0..30)];
    m:=1;
    f:=proc(n) option remember; global m,G; local k,r,j,np;
       k:=1+floor(log[2](n)); np:=2^k-n;
       if np=1 then r:=0; j:=0; else r:=1+floor(log[2](np-1)); j:=2^r-np; fi;
       if j=0 then G[k-r]; else m*G[k-r]*f(j); fi;
    end;
    [seq(f(n),n=1..120)];
    # Maple code for the general recurrence:
    G:=[seq(wt(n),n=0..30)]; # replace this by a list G=[G(0), G(1), G(2), ...], remembering that you have to tell Maple G[1] to get G(0), G[2] to get G(1), etc.
    m:=1; # replace this by the correct multiplier
    f:=proc(n) option remember; global m,G; local k,r,j,np;
       k:=1+floor(log[2](n)); np:=2^k-n;
       if np=1 then r:=0; j:=0; else r:=1+floor(log[2](np-1)); j:=2^r-np; fi;
       if j=0 then G[k-r-1+1]; else m*G[k-r-1+1]*f(j); fi;
    end;
    [seq(f(n),n=1..120)];
    # If G(n) = wt(n) and m=1 we get the present sequence
    # If G(n) = A083424(n) and m=1 we get A245537
    # If G(n) = A083424(n) and m=2 we get A245538
    # If G(n) = A083424(n) and m=4 we get A245539
    # If G(n) = A083424(n) and m=8 we get A245180 (and presumably A160239)
    # If G(n) = n (n>=0) and m=1 we get A245536
    # If G(n) = n+1 (n>=0) and m=1 we get A038374
    # If G(n) = (n+1)(n+2)/2 (n>=0) and m=1 we get A245541
    # If G(n) = (n+1)(n+2)/2 (n>=0) and m=2 we get A245547
    # If G(n) = 2^n (n>=0) and m=1 we get A245195 (= 2^A014081)
    # If G(n) = 2^n (n>=0) and m=2 we get A048896

Formula

This is an example of a class of sequences defined by the following recurrence.
We first choose a sequence G = [G(0), G(1), G(2), G(3), ...], which are the terms that will appear at the ends of the blocks: a(2^k-1) = G(k-1), and we also choose a parameter m (the "multiplier"). Then the recurrence (this defines a(1), a(2), a(3), ...) is:
a(2^k-2^r)=G(k-r-1) if 0 <= r <= k-1, a(2^k-2^r+j)=m*a(j)*G(k-r-1) if 2 <= r <= k-1, 1 <= j < 2^r-1.
To help apply the recurrence, here are the values of k,r,j for the first few values of n (if n=2^k-2^r we set j=0, although it is not used):
n: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
k: 1 2 2 3 3 3 3 4 4 4 4 4 4 4 4
r: 0 1 0 2 2 1 0 3 3 3 3 2 2 1 0
j: 0 0 0 0 1 0 0 0 1 2 3 0 1 0 0
--------------------------------------------------
n: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
k: 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
r: 4 4 4 4 4 4 4 4 3 3 3 3 2 2 1 0
j: 0 1 2 3 4 5 6 7 0 1 2 3 0 1 0 0
--------------------------------------------------
In the present example G(n) = wt(n) and m=1.

A083425 a(n) = (5*5^n + (-1)^n)/6.

Original entry on oeis.org

1, 4, 21, 104, 521, 2604, 13021, 65104, 325521, 1627604, 8138021, 40690104, 203450521, 1017252604, 5086263021, 25431315104, 127156575521, 635782877604, 3178914388021, 15894571940104, 79472859700521, 397364298502604, 1986821492513021, 9934107462565104
Offset: 0

Views

Author

Paul Barry, Apr 30 2003

Keywords

Comments

Binomial transform of A083424. Inverse binomial transform of A052934.
Primes occur at indices n = 4, 66, 100, 102, 228, 346, ..., see A138647. - R. J. Mathar, Jan 19 2011
Sum_{i=0..m} (-1)^(m+i)*5^i, for m >= 0, gives all terms of the sequence. - Bruno Berselli, Aug 28 2013

Programs

  • GAP
    List([0..25],n->(5*5^n+(-1)^n)/6); # Muniru A Asiru, Sep 21 2018
  • Magma
    [n le 2 select n^2 else 4*Self(n-1)+5*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 23 2012
    
  • Maple
    seq(coeff(series(factorial(n)*(5*exp(5*x)+exp(-x))/6,x,n+1), x, n), n = 0 .. 25); # Muniru A Asiru, Sep 21 2018
  • Mathematica
    LinearRecurrence[{4,5},{1,4},40] (* Vincenzo Librandi, Jun 23 2012 *)
  • PARI
    a(n)=(5*5^n+(-1)^n)/6 \\ Charles R Greathouse IV, Oct 07 2015
    

Formula

a(n) = (5*5^n + (-1)^n)/6.
G.f.: 1/((1+x)*(1-5x)).
E.g.f.: (5*exp(5x) + exp(-x))/6.
a(n) = Sum_{k=0..n} C(n-k,k)*4^(n-2k)*5^k. - Paul Barry, Jul 29 2004
a(n) = A015531(n+1). - R. J. Mathar, Sep 17 2008
a(n) = 4*a(n-1) + 5*a(n-2). - Vincenzo Librandi, Jun 23 2012

A245195 a(n) = 2^A014081(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 4, 8, 1, 1, 1, 2, 1, 1, 2, 4, 2, 2, 2, 4, 4, 4, 8, 16, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 4, 8, 2, 2, 2, 4, 2, 2, 4, 8, 4, 4, 4, 8, 8, 8, 16, 32, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 4, 8, 1, 1, 1, 2, 1, 1, 2, 4, 2, 2, 2, 4, 4, 4, 8, 16, 2, 2, 2, 4, 2
Offset: 0

Views

Author

N. J. A. Sloane, Jul 24 2014

Keywords

Comments

This sequence provides a bridge between A245180 (and, presumably, A160239) and A014081.
See A245196 for more about this class of sequences.
Run length transform of A011782: 1,1,2,4,8,16,32,64,... - Chai Wah Wu, Oct 19 2016

Crossrefs

Programs

  • Maple
    # This Maple program applies more generally to a sequence where the recurrence across a block is as follows. The parameters to be set are the sequence G(0), G(1), G(2), ... (the final terms in the blocks), and the multiplier m.
    # For n in the range 2^(k-1) <= n < 2^k, write n = 2^k-2^r+j, with 0 <= r <= k-1 and 0 <= j < 2^(r-1), and j=0 if r=0. Then
    # (if j=0) a(2^k-2^r) = G(k-r-1),
    # (if j>0) a(2^k-2^r+j) = m*G(k-r-1)*a(j).
    # Since Maple gives its lists an offset of 1, it is necessary to add 1 to the arguments of G.
    # For the present sequence, G(n)=2^n and m=1.
    G:=[seq(2^n,n=0..30)];
    m:=1;
    f:=proc(n) option remember; global m,G; local k,r,j,np;
    if n <= 2 then G[0+1] elif n=3 then G[1+1]
    elif n=4 then G[0+1] elif n=5 then m*G[0+1] elif n=6 then G[1+1] elif n=7 then G[2+1]
    else
       k:=1+floor(log[2](n)); np:=2^k-n;
       if np=1 then r:=0; j:=0; else r:=1+floor(log[2](np-1)); j:=2^r-np; fi;
       if j=0 then G[k-r-1+1]; else m*G[k-r-1+1]*f(j); fi;
    fi;
    end;
    [seq(f(n),n=1..520)]:
    # Setting G(n) = A083424(n) and m = 8 gives A245180. Setting G(n) = 2^n and m = 2 gives A048896.
    A245195:=n->add(binomial(n,2*k)*binomial(n,k) mod 2, k=0..floor(n/2)): seq(A245195(n), n=0..200); # Wesley Ivan Hurt, Nov 01 2016
  • Mathematica
    Table[Sum[Mod[Binomial[n, 2 k] Binomial[n, k], 2], {k, 0, n}], {n, 0, 85}] (* Michael De Vlieger, Oct 21 2016 *)
  • PARI
    a(n) = 2^hammingweight(bitand(n, n>>1)) \\ Charles R Greathouse IV, Jul 16 2016
    
  • PARI
    a(n) = sum(k=0, n, binomial(n, 2*k)*binomial(n,k) % 2); \\ Michel Marcus, Oct 21 2016
    
  • Python
    from _future_ import division
    def A277560(n):
        return sum(int(not (~n & 2*k) | (~n & k)) for k in range(n//2+1))
    
  • Python
    def A245195(n): return 1<<(n&(n>>1)).bit_count() # Chai Wah Wu, Feb 11 2023

Formula

The entries may be arranged into blocks of sizes 1,2,4,8,...:
B_0: 1,
B_1: 1, 2,
B_2: 1, 1, 2, 4,
B_3: 1, 1, 1, 2, 2, 2, 4, 8,
B_4: 1, 1, 1, 2, 1, 1, 2, 4, 2, 2, 2, 4, 4, 4, 8, 16,
B_5: 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 1, 2, 2, 2, 4, 8, 2, 2, 2, 4, 2, 2, 4, 8, 4, 4, 4, 8, 8, 8, 16, 32,
...
Consider the block B_{k-1} containing terms a(2^(k-1)), a(2^(k-1)+1), ..., a(2^k-1). It is convenient to index the terms working backwards from the next, 2^k-th, term. For n in the range 2^(k-1) <= n < 2^k, write n = 2^k-2^r+j, with 0 <= r <= k-1 and 0 <= j < 2^(r-1), and j=0 if r=0. Then
(if j=0) a(2^k-2^r) = 2^(k-r-1),
(if j>0) a(2^k-2^r+j) = 2^(k-r-1)*a(j).
a(n) = A162510(A005940(1+n)). - Antti Karttunen, Oct 29 2016
From Robert Israel, Nov 02 2016: (Start)
a(2*k) = a(k).
a(4*k+1) = a(k).
a(4*k+3) = 2*a(2*k+1).
G.f. g(x) satisfies g(x) = x + (2*x+1)*g(x^2) - x*g(x^4). (End)
Also, a(n) = Sum_{k=0..floor(n/2)} ((binomial(n,2k)*binomial(n,k)) mod 2). - Chai Wah Wu, Oct 19 2016 and Robert Israel, Nov 04 2016. For proof, see the article by Chai Wah Wu, Sums of products of binomial coefficients mod 2 and run length transforms of sequences, arXiv:1610.06166, or the Robert Israel link.

Extensions

Changed offset to 0, merged former entry A277560 from Chai Wah Wu (Oct 19 2016) with this sequence. - N. J. A. Sloane, Nov 05 2016

A246030 a(n) = (5*2^(2*n)+(-2)^(n+1))/3.

Original entry on oeis.org

1, 8, 24, 112, 416, 1728, 6784, 27392, 109056, 437248, 1746944, 6991872, 27959296, 111853568, 447381504, 1789591552, 7158235136, 28633202688, 114532286464, 458130194432, 1832518680576, 7330078916608, 29320307277824, 117281245888512, 469124949999616, 1876499867107328, 7505999334211584
Offset: 0

Views

Author

N. J. A. Sloane, Aug 15 2014

Keywords

Comments

Essentially 8 times A083424.
Equals A160239(2^n). - N. J. A. Sloane, Oct 04 2014

Crossrefs

Programs

  • Magma
    I:=[1,8]; [n le 2 select I[n] else 2*Self(n-1)+8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Feb 20 2015
  • Mathematica
    CoefficientList[Series[(1 + 6 x) / (1 - 2 x - 8 x^2), {x, 0, 30}], x] (* Vincenzo Librandi, Feb 20 2015 *)

Formula

a(0)=1, a(1)=8; thereafter a(n)=2*a(n-1)+8*a(n-2).
G.f.: (1+6*x)/(1-2*x-8*x^2).
a(n) = A001045(n+2)^2 - A001045(n)^2. - J. Conrad, Apr 05 2023
Showing 1-10 of 14 results. Next