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

A063694 Remove odd-positioned bits from the binary expansion of n.

Original entry on oeis.org

0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 1, 4, 5, 4, 5, 16, 17, 16, 17, 20, 21, 20, 21, 16, 17, 16, 17, 20, 21, 20, 21, 0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 1, 4, 5, 4, 5, 16, 17, 16, 17, 20, 21, 20, 21, 16, 17, 16, 17, 20, 21, 20, 21, 64, 65, 64, 65, 68, 69, 68, 69, 64, 65, 64, 65, 68, 69, 68
Offset: 0

Views

Author

Antti Karttunen, Aug 03 2001

Keywords

Comments

a(n) is the formal derivative of x*n (evaluated at x=2 after being lifted to Z[x]) where n is interpreted as a polynomial in GF(2)[x] via its binary expansion. - Keith J. Bauer, Mar 17 2024
In the base 4 expansion of n, change 2 to 0 and 3 to 1. - Paolo Xausa, Feb 27 2025

Examples

			a(25) = 17 because 25 = 11001 in binary and when we AND this with 10101 we are left with 10001 = 17.
		

Crossrefs

Cf. A004514, A063695 (remove even-positioned bits), A088442.

Programs

  • Haskell
    a063694 0 = 0
    a063694 n = 4 * a063694 n' + mod q 2
                where (n', q) = divMod n 4
    -- Reinhard Zumkeller, Sep 26 2015
    
  • Magma
    function A063694(n)
      if n le 1 then return n;
      else return 4*A063694(Floor(n/4)) + ((n mod 4) mod 2);
      end if; return A063694;
    end function;
    [A063694(n): n in [0..120]]; // G. C. Greubel, Dec 05 2022
    
  • Maple
    every_other_pos := proc(nn, x, w) local n, i, s; n := nn; i := 0; s := 0; while(n > 0) do if((i mod 2) = w) then s := s + ((x^i)*(n mod x)); fi; n := floor(n/x); i := i+1; od; RETURN(s); end: [seq(every_other_pos(j, 2, 0), j=0..120)];
  • Mathematica
    a[n_] := BitAnd[n, Sum[2^k, {k, 0, Log[2, n] // Floor, 2}]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 28 2016 *)
    A063694[n_] := FromDigits[ReplaceAll[IntegerDigits[n, 4], {2 -> 0, 3 -> 1}], 4];
    Array[A063694, 100, 0] (* Paolo Xausa, Feb 27 2025 *)
  • PARI
    a(n)=sum(k=0,n,(-1)^k*2^k*floor(n/2^k))  /* since n> ceil(log(n)/log(2)) */
    
  • PARI
    a(n)=if(n<0,0,sum(k=0,n,(-1)^k*2^k*floor(n/2^k))) /* since n> ceil(log(n)/log(2)) */
    
  • Python
    def A063694(n): return n&((1<<(m:=n.bit_length())+(m&1))-1)//3 # Chai Wah Wu, Jan 30 2023
  • SageMath
    def A063694(n):
        if (n<2): return n
        else: return 4*A063694(floor(n/4)) + ((n%4)%2)
    [A063694(n) for n in range(121)] # G. C. Greubel, Dec 05 2022
    

Formula

a(n) = Sum_{k>=0} (-1)^k*2^k*floor(n/2^k).
a(n) + A063695(n) = n.
a(n) = n - 2*a(floor(n/2)). - Vladeta Jovovic, Feb 23 2003
G.f.: 1/(1-x) * Sum_{k>=0} (-2)^k*x^2^k/(1-x^2^k). - Ralf Stephan, May 05 2003
a(n) = 4*a(floor(n/4)) + (n mod 4) mod 2. - Reinhard Zumkeller, Sep 26 2015
a(n) = Sum_{k>=0} A030308(n,k)*A199572(k). - Philippe Deléham, Jan 12 2023

A065143 a(n) = Sum_{k=0..n} Stirling2(n,k)*(1+(-1)^k)*2^k/2.

Original entry on oeis.org

1, 0, 4, 12, 44, 220, 1228, 7196, 45004, 303900, 2201676, 16920860, 136966860, 1163989788, 10364408140, 96463232284, 935872773068, 9440653262620, 98809201693260, 1071131795708188, 12007932126074060
Offset: 0

Views

Author

Karol A. Penson, Oct 17 2001

Keywords

Comments

Stirling transform of A199572 (aerated powers of 4).

Crossrefs

Column k=4 of A357681.

Programs

  • Mathematica
    Table[Sum[StirlingS2[n,k]*(1+(-1)^k)*2^k/2,{k,0,n}],{n,0,20}] (* Vaclav Kotesovec, Aug 06 2014 *)
    Table[(BellB[n, 2] + BellB[n, -2])/2, {n, 0, 20}] (* Vladimir Reshetnikov, Nov 01 2015 *)
  • PARI
    a(n) = sum(k=0, n, stirling(n,k,2)*(1+(-1)^k)*2^k/2); \\ Michel Marcus, Nov 02 2015
    
  • PARI
    x='x+O('x^50); Vec(serlaplace(cosh(2*exp(x)-2))) \\ G. C. Greubel, Nov 16 2017

Formula

Representation as a sum of an infinite series: a(n) = exp(2)*Sum_{k = 0..infinity} ((2*k)^n*2^(2*k)/(2*k)!) - sinh(2)*sum_{k = 0..infinity}(k^n*2^k/k!), for n >= 0.
E.g.f.: cosh(2*exp(x)-2). - Vladeta Jovovic, Sep 14 2003
From Vaclav Kotesovec, Aug 06 2014: (Start)
a(n) ~ n^n * cosh(2*exp(r)-2) / (r^n * (exp(n) * sqrt(4*exp(2*r)*r^2/n + 1-n+r))), where r is the root of the equation -2*exp(r)*r*tanh(2-2*exp(r)) = n.
(a(n)/n!)^(1/n) ~ exp(1/LambertW(n/2)) / LambertW(n/2).
(End)
a(n) = (Bell_n(2) + Bell_n(-2))/2, where Bell_n(x) is n-th Bell polynomial. - Vladimir Reshetnikov, Nov 01 2015
a(n) = 1; a(n) = 4 * Sum_{k=0..n-1} binomial(n-1, k) * A357598(k). - Seiichi Manyama, Oct 12 2022

A052992 Expansion of 1/((1 - x)*(1 - 2*x)*(1 + 2*x)).

Original entry on oeis.org

1, 1, 5, 5, 21, 21, 85, 85, 341, 341, 1365, 1365, 5461, 5461, 21845, 21845, 87381, 87381, 349525, 349525, 1398101, 1398101, 5592405, 5592405, 22369621, 22369621, 89478485, 89478485, 357913941, 357913941, 1431655765, 1431655765, 5726623061, 5726623061
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

a(n) is the sum of square divisors of 2^n. - Paul Barry, Oct 13 2005
Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 131", based on the 5-celled von Neumann neighborhood. See A279053 for references and links. - Robert Price, Dec 05 2016

Crossrefs

Programs

  • GAP
    Flat(List([1..17],n->[(4^n-1)/3,(4^n-1)/3])); # Muniru A Asiru, Oct 21 2018
    
  • Magma
    [&+[2^k*(1 + (-1)^k)/2: k in [0..n]]: n in [0..50]]; // Vincenzo Librandi, Oct 21 2018
  • Maple
    spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z),Union(Z,Z))),Sequence(Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
  • Mathematica
    CoefficientList[Series[1/((1-x)(1-2x)(1+2x)),{x,0,40}],x] (* or *) LinearRecurrence[{1,4,-4},{1,1,5},40] (* or *) With[{c= LinearRecurrence[ {5,-4},{1,5},20]},Riffle[c,c]] (* Harvey P. Dale, Sep 12 2015 *)
    (4^(1 + Floor[(Range@40-1)/2])-1)/3 (* Federico Provvedi, Oct 19 2018 *)
  • Python
    for n in range(0,40): print((int(4**(1+int((n+2)/2)-1)/3)), end=', ') # Stefano Spezia, Oct 19 2018
    
  • Python
    [4**(1+(n+2)//2-1)//3 for n in range(40)] # Pascal Bisson, Feb 03 2022
    

Formula

G.f.: 1/(-1+4*x^2)/(-1+x).
Recurrence: {a(1)=1, a(0)=1, -4*a(n) - 1 + a(n+2) = 0}.
a(n) = -1/3 + Sum((1/6)*(1+4*_alpha)*_alpha^(-1-n), where _alpha=RootOf(-1+4*_Z^2))
a(n) = Sum_{k=0..n} 2^k(1+(-1)^k)/2. - Paul Barry, Nov 24 2003
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3). - Paul Curtz, Apr 27 2011
a(n) = (4^(1 + floor(n/2)) - 1)/3. - Federico Provvedi, Oct 19 2018
a(n)-a(n-1) = A199572(n). - R. J. Mathar, Feb 27 2019
a(n) = A263053(n)/2. - Pascal Bisson, Feb 03 2022

Extensions

More terms from James Sellers, Jun 08 2000

A263973 T(n,k)=Number of (n+1)X(k+1) arrays of permutations of 0..(n+1)*(k+1)-1 with each element having index change (+-,+-) 0,2 1,1 or 1,0.

Original entry on oeis.org

4, 20, 0, 108, 72, 16, 465, 1817, 1441, 0, 2265, 10720, 86633, 13856, 64, 10920, 89472, 2604481, 2940624, 189993, 0, 52752, 1791696, 102742049, 226810352, 118376593, 2215960, 256, 253176, 27783305, 4952396901, 24130893568, 31702909989
Offset: 1

Views

Author

R. H. Hardin, Oct 30 2015

Keywords

Comments

Table starts
....4........20..........108...........465...........2265.........10920
....0........72.........1817.........10720..........89472.......1791696
...16......1441........86633.......2604481......102742049....4952396901
....0.....13856......2940624.....226810352....24130893568.4071813326144
...64....189993....118376593...31702909989.11743850653769
....0...2215960...4465927225.3594130469760
..256..28027420.173624682220
....0.340646784
.1024

Examples

			Some solutions for n=3 k=4
..2..3..6..9..8....2..3..6..1..9....2..5..4..1..8....2..5..4..9..8
..7..0..1..4.14....7..0..5.12..4....7..0..3.14.13....7..0..1.13..3
..5.15.17.18.19...16.15..8.17.18....6.16.18.19..9...12..6.17.19.18
.10.12.11.16.13...10.11.19.13.14...11.10.15.12.17...11.10.15.16.14
		

Crossrefs

Column 1 is A199572(n+1).
Row 1 is A263965.

Formula

Empirical for column k:
k=1: a(n) = 4*a(n-2)
k=2: [order 10]
k=3: [order 27]
k=4: [order 53]
Empirical for row n:
n=1: [linear recurrence of order 22]

A162516 Triangle of coefficients of polynomials defined by Binet form: P(n,x) = ((x+d)^n + (x-d)^n)/2, where d=sqrt(x+4).

Original entry on oeis.org

1, 1, 0, 1, 1, 4, 1, 3, 12, 0, 1, 6, 25, 8, 16, 1, 10, 45, 40, 80, 0, 1, 15, 75, 121, 252, 48, 64, 1, 21, 119, 287, 644, 336, 448, 0, 1, 28, 182, 588, 1457, 1360, 1888, 256, 256, 1, 36, 270, 1092, 3033, 4176, 6240, 2304, 2304, 0, 1, 45, 390, 1890, 5925, 10801, 17780, 11680, 12160, 1280, 1024
Offset: 0

Views

Author

Clark Kimberling, Jul 05 2009

Keywords

Examples

			First six rows:
  1;
  1,  0;
  1,  1,  4;
  1,  3, 12,  0;
  1,  6, 25,  8, 16;
  1, 10, 48, 40, 80, 0;
		

Crossrefs

For fixed k, the sequences P(n,k), for n=1,2,3,4,5, are A084057, A084059, A146963, A081342, A081343, respectively.

Programs

  • Magma
    m:=12;
    p:= func< n,x | ((x+Sqrt(x+4))^n + (x-Sqrt(x+4))^n)/2 >;
    R:=PowerSeriesRing(Rationals(), m+1);
    T:= func< n,k | Coefficient(R!( p(n,x) ), n-k) >;
    [T(n,k): k in [0..n], n in [0..m]]; // G. C. Greubel, Jul 09 2023
    
  • Mathematica
    P[n_, x_]:= P[n, x]= ((x+Sqrt[x+4])^n + (x-Sqrt[x+4])^n)/2;
    T[n_, k_]:= Coefficient[Series[P[n, x], {x,0,n-k+1}], x, n-k];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 08 2020; Jul 09 2023 *)
  • SageMath
    def p(n,x): return ((x+sqrt(x+4))^n + (x-sqrt(x+4))^n)/2
    def T(n,k):
        P. = PowerSeriesRing(QQ)
        return P( p(n,x) ).list()[n-k]
    flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jul 09 2023

Formula

P(n,x) = 2*x*P(n-1,x) - (x^2 -x -4)*P(n-2,x).
From G. C. Greubel, Jul 09 2023: (Start)
T(n, k) = [x^(n-k)] ( ((x+sqrt(x+4))^n + (x-sqrt(x+4))^n)/2 ).
T(n, 1) = A000217(n-1), n >= 1.
T(n, n) = A199572(n).
Sum_{k=0..n} T(n, k) = A084057(n).
Sum_{k=0..n} 2^k*T(n, k) = A125818(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A026150(n).
Sum_{k=0..n} (-2)^k*T(n, k) = A133343(n). (End)

A199571 Table version of the array of number of round trips of length L from any of the N vertices of the cycle graph C_N.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 4, 0, 1, 0, 0, 2, 0, 1, 0, 16, 2, 2, 0, 1, 0, 0, 6, 0, 2, 0, 1, 0, 64, 10, 8, 0, 2, 0, 1, 0, 0, 22, 0, 6, 0, 2, 0, 1, 0, 256, 42, 32, 2, 6, 0, 2, 0, 1, 0, 0, 86, 0, 20, 0, 6, 0, 2, 0, 1, 0, 1024, 170, 128, 14, 22, 0, 6, 0, 2, 0, 1, 0, 0
Offset: 0

Views

Author

Wolfdieter Lang, Nov 08 2011

Keywords

Comments

Let w(N,L) be the number of return paths (round trip walks) of length L >= 0 from any vertex of the cycle graph C_N, N >= 1. (Due to cyclic symmetry, this array w(N,L) is independent of the start vertex.) w(N,L) = trace(AC(N)^L)/N = Sum_{k=0..N-1} x^{(N)}_k, with the N X N adjacency matrix AC(N) of the cycle graph C_N, and x^{(N)}_k are the zeros of the characteristic polynomial C(N,x) of AC(N). See A198637 for the coefficient triangle for C(N,x). C(N,x) = 2*(T(N,x/2)-1) for N >= 2. These zeros are x^{(N)}_k = 2*cos(2*Pi*k/N), N >= 2 (from T(N,x/2)=1). For N=1 one has C(1,x)=x with x^{(1)}_0 = 0. This sum formula for w(n,L) has been given in a comment to A054877 (N=5 case) by H. Kociemba. For N=1 one uses 0^0 := 1 to obtain w(1,L) = delta(L,0) (Kronecker's delta-symbol).
The o.g.f. G(N,x) := Sum_{L>=0} w(N,L)*x^L is, by a general result on moments of zeros of polynomials (see the W. Lang reference, theorem 5, p. 244),
y*(d/dx)C(N,x)/(N*C(N,x)), with y=1/x. This becomes for N >= 2: G(N,x) = y*S(N-1,y)/(2*T(N,y/2)-1) with y=1/x. For N=1 one has G(1,x)=1 (not 1/(1-2*x)). In the formula section this N >= 2 result is given explicitly, using the Binet-de Moivre form of the S- and T-polynomials.

Examples

			The triangle a(K,N) = w(N,K-N+1) begins
K\N  1    2     3    4    5    6    7   8   9  10 ...
0:   1
1:   0    1
2:   0    0     1
3:   0    4     0    1
4:   0    0     2    0    1
5:   0   16     2    2    0    1
6:   0    0     6    0    2    0    1
7:   0   64    10    8    0    2    0   1
8:   0    0    22    0    6    0    2   0   1
9:   0  256    42   32    2    6    0   2   0   1
...
The array w(N,L) begins
N\L   0   1   2   3   4   5   6   7    8    9    10 ...
1:    1   0   0   0   0   0   0   0    0    0     0
2:    1   0   4   0  16   0  64   0  256    0  1024
3:    1   0   2   2   6  10  22  42   86  170   342
4:    1   0   2   0   8   0  32   0  128    0   512
5:    1   0   2   0   6   2  20  14   70   72   254
6:    1   0   2   0   6   0  22   0   86    0   342
7:    1   0   2   0   6   0  20   2   70   18   252
8:    1   0   2   0   6   0  20   0   72    0   272
9:    1   0   2   0   6   0  20   0   70    2   252
10:   1   0   2   0   6   0  20   0   70    0   254
...
w(1,0)=1, one vertex considered.
For N >= 2 the vertices (nodes) of C_N are numbered consecutively in the positive sense by 1,2,...,N. W.l.o.g. one can take the vertex number 1 as start of the return trip.
w(3,4)=6 from the six return paths 12121, 13131, 12131, 13121, 12321 and 13231.
w(5,5)=2 from the two return paths 123451 and 154321.
		

Crossrefs

Cf. A198633 (walks on the P_N graph).
The N=1,...,10 sequences are A000007, A199572, A078008, A199573, A054877, A047849, A094659, A063376, A094233, A095929.

Formula

a(K,L) = w(N,K-N+1), K >= 0, n=1,...,K+1, with w(N,L) defined as return walk numbers of length L of the cycle graph C_N in the comment section above.
w(N,L) = Sum_{k=0..N-1} (2*cos(2*Pi*k)/N)^L, N >= 2. For N=1 one has w(1,0)=1 and w(1,L)=0 if L >= 1.
O.g.f. G(N,x) for w(N,L): for N >= 2:
y*S(N-1,y)/(2*(T(N,y/2)-1)) with y=1/x, and for N=1 one has G(1,x)=1. This can, for N >= 2, be written as
G(N,x) = sinh(N*log(2*x/(1-sqrt(1-(2*x)^2))))/(sqrt(1-(2*x)^2)*(cosh(N*log(2*x/(1-sqrt(1-(2*x)^2))))-1)).

A103424 Expansion of e.g.f.: 1 + sinh(2*x).

Original entry on oeis.org

1, 2, 0, 8, 0, 32, 0, 128, 0, 512, 0, 2048, 0, 8192, 0, 32768, 0, 131072, 0, 524288, 0, 2097152, 0, 8388608, 0, 33554432, 0, 134217728, 0, 536870912, 0, 2147483648, 0, 8589934592, 0, 34359738368, 0, 137438953472, 0, 549755813888, 0, 2199023255552
Offset: 0

Views

Author

Paul Barry, Feb 05 2005

Keywords

Comments

Binomial transform is A103425.

Crossrefs

Programs

  • Mathematica
    With[{nn=50},CoefficientList[Series[1+Sinh[2x],{x,0,nn}],x] Range[ 0,nn-1]!] (* Harvey P. Dale, Jun 29 2014 *)
    CoefficientList[Series[(1 + 2 x - 4 x^2)/(1 - 4 x^2), {x, 0, 50}], x] (* Vincenzo Librandi, Jun 30 2014 *)

Formula

G.f.: (1+2*x-4*x^2)/(1-4*x^2).
E.g.f.: 1 + sinh(2*x).
a(n) = 0^n+(2^n-(-2)^n)/2.
a(n) = Sum_{k=0..n} binomial(n, k)*(-1)^(k(n-k)).
a(n+1) = 2*A199572(n) = 2*A077957(n)^2. [Ralf Stephan, Jul 17 2013]

A094659 Number of closed walks of length n at a vertex of the cyclic graph on 7 nodes C_7.

Original entry on oeis.org

1, 0, 2, 0, 6, 0, 20, 2, 70, 18, 252, 110, 924, 572, 3434, 2730, 12902, 12376, 48926, 54264, 187036, 232562, 720062, 980674, 2789164, 4086550, 10861060, 16878420, 42484682, 69242082, 166823430, 282580872, 657178982, 1148548016, 2595874468
Offset: 0

Views

Author

Herbert Kociemba, Jun 06 2004

Keywords

Comments

In general, a(n,m) = (2^n/m)*Sum_{k=0..m-1} cos(2*Pi*k/m)^n gives the number of closed walks of length n at a vertex of the cyclic graph on m nodes C_m.

Crossrefs

Cf. A199572 (m=2), A078008 (m=3), A199573 (m=4), A054877 (m=5), A047849 (bisection of m=6), A063376 (bisection of m=8), A094233 (m=9), A095929 (bisection of m=10), A087433 (bisection of m=12).

Programs

  • Mathematica
    f[n_] := FullSimplify[ TrigToExp[ 2^n/7 Sum[Cos[2Pi*k/7]^n, {k, 0, 6}]]]; Table[ f[n], {n, 0, 36}] (* Robert G. Wilson v, Jun 09 2004 *)
    LinearRecurrence[{1,4,-3,-2},{1,0,2,0},40] (* Harvey P. Dale, Jun 12 2014 *)

Formula

a(n) = (2^n/7)*Sum_{k=0..6} cos(2*Pi*k/7)^n.
a(n) = 7(a(n-2) - 2a(n-4) + a(n-6)) + 2a(n-7).
G.f.: (1-x-2x^2+x^3)/((2x-1)(-1-x+2x^2+x^3)).
a(0)=1, a(1)=0, a(2)=2, a(3)=0, a(n)=a(n-1)+4*a(n-2)-3*a(n-3)-2*a(n-4). - Harvey P. Dale, Jun 12 2014
7*a(n) = 2^n + 2*A094648(n). - R. J. Mathar, Nov 03 2020

Extensions

More terms from Robert G. Wilson v, Jun 09 2004
Showing 1-8 of 8 results.