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.

Previous Showing 21-27 of 27 results.

A378299 Read the binary representation of n from the most to least significant bit then perform a cumulative XOR and store by reading from least to most significant bit.

Original entry on oeis.org

0, 1, 1, 2, 1, 6, 2, 5, 1, 14, 6, 9, 2, 13, 5, 10, 1, 30, 14, 17, 6, 25, 9, 22, 2, 29, 13, 18, 5, 26, 10, 21, 1, 62, 30, 33, 14, 49, 17, 46, 6, 57, 25, 38, 9, 54, 22, 41, 2, 61, 29, 34, 13, 50, 18, 45, 5, 58, 26, 37, 10, 53, 21, 42, 1, 126, 62, 65, 30, 97, 33, 94
Offset: 0

Views

Author

Darío Clavijo, Nov 22 2024

Keywords

Comments

a(n) is Gray-coded into the reversed binary representation of n.
Fixed points are 0 and f(n) = 8*f(n-1) + 5 with f(1)=1 or f(n) = (1/14)*(3*(2^(3*n))-10) for n >= 1 (cf. A380001).

Examples

			For n = 75 a(75) = 78 because:
75 in base 2 is 1001011 and in base 2:
  m      | x = x XOR (m AND 1) | o
---------+---------------------+----------
1001011  | 1 = 0 XOR 1         |       1
100101   | 0 = 1 XOR 1         |      10
10010    | 0 = 0 XOR 0         |     100
1001     | 1 = 0 XOR 1         |    1001
100      | 1 = 1 XOR 0         |   10011
10       | 1 = 1 XOR 0         |  100111
1        | 0 = 1 XOR 1         | 1001110
And 1001110 in base 10: 78
		

Crossrefs

Programs

  • Mathematica
    A378299[n_] := FromDigits[FoldList[BitXor, 0, Reverse[IntegerDigits[n, 2]]], 2];
    Array[A378299, 100, 0] (* Paolo Xausa, Dec 13 2024 *)
  • Python
    def a(n):
      m,x,o = n,0,0
      while m > 0:
        x ^= (m & 1)
        o <<= 1
        o |= x
        m >>=1
      return o
    print([a(n) for n in range(0,71)])

Formula

a(n) = A006068(A030101(n)).
a(A000079(n)) = 1.
a(A007283(n)) = 2.
a(A000225(n)) = A000975(n).
a(A000051(n)) = A095121(n).

A127509 Number of n-tuples where each entry is chosen from the subsets of {1,2,3} such that the intersection of all n entries contains exactly one element.

Original entry on oeis.org

3, 27, 147, 675, 2883, 11907, 48387, 195075, 783363, 3139587, 12570627, 50307075, 201277443, 805208067, 3221028867, 12884508675, 51538821123, 206156857347, 824630575107, 3298528591875, 13194126950403, 52776532967427
Offset: 1

Views

Author

Peter C. Heinig (algorithms(AT)gmx.de), Apr 17 2007

Keywords

Comments

There is the following general formula: The number T(n,k,r) of n-tuples where each entry is chosen from the subsets of {1,2,..,k} such that the intersection of all n entries contains exactly r elements is: T(n,k,r) = C(k,r) * (2^n - 1)^(k-r). This may be shown by exhibiting a bijection to a set whose cardinality is obviously C(k,r) * (2^n - 1)^(k-r), namely the set of all k-tuples where each entry is chosen from subsets of {1,..,n} in the following way: Exactly r entries must be {1,..,n} itself (there are C(k,r) ways to choose them) and the remaining (k-r) entries must be chosen from the 2^n-1 proper subsets of {1,..,n}, i.e. for each of the (k-r) entries, {1,..,n} is forbidden (there are, independent of the choice of the full entries, (2^n - 1)^(k-r) possibilities to do that, hence the formula). The bijection into this set is given by (X_1,..,X_n) |-> (Y_1,..,Y_k) where for each j in {1,..,k} and each i in {1,..,n}, i is in Y_j if and only if j is in X_i.

Examples

			a(1)=3 because the three sequences of length one are: ({1}), ({2}), ({3}).
a(2)=27 because the twenty-seven sequences of length two are:
  ({1},{1}), ({2},{2}), ({3},{3}), ({1},{1,2}),
  ({1},{1,3}), ({2},{1,2}), ({2},{2,3}), ({3},{1,3}),
  ({3},{2,3}), ({1,2},{1}), ({1,3},{1}), ({1,2},{2}),
  ({2,3},{2}), ({1,3},{3}), ({2,3},{3}), ({1},{1,2,3}),
  ({2},{1,2,3}), ({3},{1,2,3}), ({1,2,3},{1}), ({1,2,3},{2}),
  ({1,2,3},{3}), ({1,2},{1,3}), ({1,3},{1,2}), ({1,2},{2,3}),
  ({2,3},{1,2}), ({1,3},{2,3}), ({2,3},{1,3}).
		

Crossrefs

Programs

  • Maple
    for k from 1 to 41 do 3*(2^k-1)^2; od;
  • Mathematica
    LinearRecurrence[{7,-14,8},{3,27,147},22] (* James C. McMahon, Jan 02 2025 *)

Formula

a(n) = 3*(2^n-1)^2.
G.f.: 3*x*(1+2*x)/(1-7*x+14*x^2-8*x^3). [Colin Barker, Feb 08 2012]

A131131 4*A007318 - 3*A097806.

Original entry on oeis.org

1, 1, 1, 4, 5, 1, 4, 12, 9, 1, 4, 16, 24, 13, 1, 4, 20, 40, 40, 17, 1, 4, 24, 60, 80, 60, 21, 1, 4, 28, 84, 140, 140, 84, 25, 1, 4, 32, 112, 224, 280, 224, 112, 29, 1
Offset: 0

Views

Author

Gary W. Adamson, Jun 16 2007

Keywords

Comments

Row sums = A131130, (1, 2, 10, 26, 52, 98, 190, ...), the binomial transform of (1, 1, 7, 1, 7, 1, ...). Generally, triangles generated from N*A007318 - (N-1)*A097806 have row sums that are binomial transforms of (1, 1, (N-1), 1, (N-1), 1, ...). A095121 = (1, 2, 6, 14, 30, 62, ...), the binomial transform of (1, 1, 3, 1, 3, 1, ...) and = row sums of A131108.
Triangle T(n,k), 0 <= k <= n,read by rows given by [1,3,-4,1,0,0,0,0,0,0,0,...] DELTA [1,0,0,1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Dec 18 2007

Examples

			First few rows of the triangle:
  1;
  1,  1;
  4,  5,  1;
  4, 12,  9,  1;
  4, 16, 24, 13,  1
  4, 20, 40, 40, 17,  1;
  ...
		

Crossrefs

Formula

4*A007318 - 3*A097806, where A007318 = Pascal's triangle and A097806 = the pairwise operator.
G.f.: (1-x*y+3*x^2+3*x^2*y)/((-1+x+x*y)*(x*y-1)). - R. J. Mathar, Aug 12 2015

A166065 Triangle, read by rows, given by [0,1,1,0,0,0,0,0,0,0,...] DELTA [2,-1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 0, 2, 0, 2, 2, 0, 4, 2, 2, 0, 8, 4, 2, 2, 0, 16, 8, 4, 2, 2, 0, 32, 16, 8, 4, 2, 2, 0, 64, 32, 16, 8, 4, 2, 2, 0, 128, 64, 32, 16, 8, 4, 2, 2, 0, 256, 128, 64, 32, 16, 8, 4, 2, 2, 0, 512, 256, 128, 64, 32, 16, 8, 4, 2, 2, 0, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 2, 0, 2048, 1024
Offset: 0

Views

Author

Philippe Deléham, Oct 05 2009

Keywords

Examples

			Triangle begins :
1,
0,2,
0,2,2,
0,4,2,2,
0,8,4,2,2,
0,16,8,4,2,2,
0,32,16,8,4,2,2,
0,64,32,16,8,4,2,2,
0,128,64,32,16,8,4,2,2,
0,256,128,64,32,16,8,4,2,2,
0,512,256,128,64,32,16,8,4,2,2,
		

Formula

Sum_{k, 0<=k<=n} T(n,k)*x^k = (-1)^n*A084247(n), A000007(n), A000079(n), A001787(n+1), A166060(n), A165665(n), A083585(n) for x= -1, 0, 1, 2, 3, 4, 5 respectively. Sum_{k, 0<=k<=n} T(n,k)*x^(n-k) = A040000(n), A000079(n), A095121(n), A047851(n), A047853(n), A047855(n) for x = 0, 1, 2, 3, 4, 5 respectively.
G.f.: (1-2*x+x*y)/((-1+2*x)*(x*y-1)). - R. J. Mathar, Aug 11 2015

A255049 a(n) = 2*A160552(n).

Original entry on oeis.org

0, 2, 2, 6, 2, 6, 10, 14, 2, 6, 10, 14, 10, 22, 34, 30, 2, 6, 10, 14, 10, 22, 34, 30, 10, 22, 34, 38, 42, 78, 98, 62, 2, 6, 10, 14, 10, 22, 34, 30, 10, 22, 34, 38, 42, 78, 98, 62, 10, 22, 34, 38, 42, 78, 98, 70, 42, 78, 106, 118, 162, 254, 258, 126, 2, 6, 10, 14, 10
Offset: 0

Views

Author

Omar E. Pol, Feb 13 2015

Keywords

Examples

			Written as an irregular triangle in which row lengths are the terms of A011782 the sequence begins:
0;
2;
2,6;
2,6,10,14;
2,6,10,14,10,22,34,30;
2,6,10,14,10,22,34,30,10,22,34,38,42,78,98,62;
2,6,10,14,10,22,34,30,10,22,34,38,42,78,98,62,10,22,34,38,42,78,98,70,42,78,106,118,162,254,258,126;
It appears that row sums give 0 together with A004171, (see also A081294).
It appears that right border gives the nonnegative terms of A000918, (see also A095121).
		

Crossrefs

Formula

It appears that a(n) = A169708(n)/2, n >= 1.

Extensions

Edited by Omar E. Pol, Feb 18 2015

A351839 Triangle read by rows: T(n, k) = A027375(n)*Sum_{m=1..floor(n/k)} binomial(n, k*m).

Original entry on oeis.org

2, 6, 2, 14, 6, 6, 30, 14, 24, 12, 62, 30, 60, 60, 30, 126, 62, 126, 180, 180, 54, 254, 126, 252, 420, 630, 378, 126, 510, 254, 504, 852, 1680, 1512, 1008, 240, 1022, 510, 1014, 1620, 3780, 4536, 4536, 2160, 504, 2046, 1022, 2040, 3060, 7590, 11340, 15120, 10800, 5040, 990
Offset: 1

Views

Author

Stefano Spezia, Feb 21 2022

Keywords

Comments

T(n, k) is the number of k-th roots of unity as eigenvalues of the quantum operator O for a free Motzkin spin chain of length n. For k = 1, it gives the correct result if one excludes the eigenvalue 2.
For the definitions of both a free Motzkin spin chain and the quantum operator O, see Hao et al.

Examples

			Triangle begins:
    2;
    6,   2;
   14,   6,   6;
   30,  14,  24,  12;
   62,  30,  60,  60,  30;
  126,  62, 126, 180, 180,  54;
  254, 126, 252, 420, 630, 378, 126;
  ...
		

Crossrefs

Cf. A000918 (k = 2), A007318, A024023 (row sums), A027375 (leading diagonal), A095121 (k = 1).

Programs

  • Mathematica
    g[n_]:= DivisorSum[n,(2^#)*MoebiusMu[n/#]&]; binomSum[n_,k_]:=Sum[Binomial[n, i],{i,k,n,k}]; T[n_,k_]:=g[k]*binomSum[n,k]; (* See p. 9 in Hao et al. *)
    Flatten[Table[T[n,k],{n,10},{k,n}]]
  • PARI
    T(n,k) = sumdiv(k,d,moebius(d)*2^(k/d))*sum(m=1,n\k,binomial(n,k*m)) \\ Andrew Howroyd, Feb 21 2022

A154312 Triangle T(n,k), 0<=k<=n, read by rows, given by [0,1/2,-1/2,0,0,0,0,0,0,0,...] DELTA [2,-1/2,-1/2,2,0,0,0,0,0,0,0 ...] where DELTA is the operator defined in A084938 .

Original entry on oeis.org

1, 0, 2, 0, 1, 3, 0, 0, 3, 5, 0, 0, 0, 7, 9, 0, 0, 0, 0, 15, 17, 0, 0, 0, 0, 0, 31, 33, 0, 0, 0, 0, 0, 0, 63, 65, 0, 0, 0, 0, 0, 0, 0, 127, 129, 0, 0, 0, 0, 0, 0, 0, 0, 255, 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 511, 513, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1023, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2047
Offset: 0

Views

Author

Philippe Deléham, Jan 07 2009

Keywords

Comments

Column sums give A003945.

Examples

			Triangle begins:
1;
0, 2;
0, 1, 3;
0, 0, 3, 5;
0, 0, 0, 7, 9;
0, 0, 0, 0, 15, 17; ...
		

Crossrefs

Formula

Sum_{k, 0<=k<=n}T(n,k)*x^(n-k)= A040000(n), A094373(n), A000079(n), A083329(n), A095121(n), A154117(n), A131128(n), A154118(n), A131130(n), A154251(n), A154252(n) for x = -1,0,1,2,3,4,5,6,7,8,9 respectively.
G.f.: (1-x*y+x^2*y-x^2*y^2)/(1-3*x*y+2*x^2*y^2). - Philippe Deléham, Nov 02 2013
T(n,k) = 3*T(n-1,k-1) - 2*T(n-2,k-2), T(0,0) = 1, T(1,0) = 0, T(1,1) = 2, T(2,0) = 0, T(2,1) = 1, T(2,2) = 3, T(n,k) = 0 if k<0 or if k>n. - Philippe Deléham, Nov 02 2013
Previous Showing 21-27 of 27 results.