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.

A168309 Period 2: repeat 4,-3.

Original entry on oeis.org

4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3, 4, -3
Offset: 1

Views

Author

Klaus Brockhaus, Nov 22 2009

Keywords

Comments

Interleaving of A010709 and -3*A000012.
Binomial transform of 4 followed by a signed version of A005009.
Inverse binomial transform of 4 followed by A000079.
a(n+1) - a(n) = 7*(-1)^n.
A168230 without initial term 0 gives partial sums.
Nonsimple continued fraction expansion of 2+2*sqrt(2/3) = 3.6329931618... - R. J. Mathar, Mar 08 2012

Crossrefs

Cf. A010709 (all 4's sequence), A000012 (all 1's sequence), A010727 (all 7's sequence), A168230, A005009 (7*2^n), A000079 (powers of 2).

Programs

  • Magma
    &cat[ [4, -3]: n in [1..42] ];
    [ n eq 1 select 4 else -Self(n-1)+1: n in [1..84] ];
  • Mathematica
    LinearRecurrence[{0,1},{4, -3}, 50] (* or *) Table[(1 - 7*(-1)^n)/2,{n,0,25}] (* G. C. Greubel, Jul 17 2016 *)
    PadRight[{},120,{4,-3}] (* Harvey P. Dale, Oct 20 2018 *)

Formula

a(n) = (1 - 7*(-1)^n)/2.
a(n) = -a(n-1) + 1 for n > 1; a(1) = 4.
a(n) = a(n-2) for n > 2; a(1) = 4, a(2) = -3.
G.f.: x*(4 - 3*x)/((1-x)*(1+x)).
E.g.f.: (1/2)*(-1 + exp(x))*(7 + exp(x))*exp(-x). - G. C. Greubel, Jul 17 2016

A239304 Triangle of permutations corresponding to the compressed square roots of Gray code * bit-reversal permutation (A239303).

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 4, 2, 1, 3, 2, 5, 4, 1, 3, 2, 5, 6, 3, 1, 4, 6, 2, 3, 7, 5, 1, 4, 7, 3, 2, 6, 8, 4, 1, 5, 3, 8, 7, 2, 4, 9, 6, 1, 5, 3, 8, 9, 4, 2, 7, 10, 5, 1, 6, 9, 3, 4, 10, 8, 2, 5, 11, 7, 1, 6, 10, 4, 3, 9
Offset: 1

Views

Author

Tilman Piesk, Mar 14 2014

Keywords

Comments

The symmetrical binary matrices corresponding to the rows of A239303 can be interpreted as adjacency matrices of undirected graphs. These graphs are chains where one end is connected to itself, so they can be interpreted as permutations. The end connected to itself is always the first element of the permutation, i.e., on the left side of the triangle.
Columns of the square array:
T(m,1) = A008619(m) = 1,2,2,3,3...
T(m,2) = 1,1,1...
T(m,3) = A028242(m+3) = 3,2,4,3,5,4,6,5,7,6,8,7,9,8,10,9,11,10,12...
T(m,4) = m+3 = 4,5,6...
T(m,5) = A084964(m+4) = 2,5,3,6,4,7,5,8,6,9,7,10,8,11,9,12,10,13...
T(m,6) = 2,2,2...
T(m,7) = A168230(m+5) = 6,3,7,4,8,5,9,6,10,7,11,8,12,9,13,10,14...
T(m,8) = m+6 = 7,8,9...
T(m,9) = A152832(m+9) = 3,8,4,9,5,10,6,11,7,12,8,13,9,14,10,15...
T(m,10) = 3,3,3...
Diagonals of the square array:
T(n,n) = a(A001844(n)) = 1,1,4,7,4,2,9,14,7,3,14,21,10,4,19,28,13,5,24...
T(n,2n-1) = a(A064225(n)) = 1,2,3...
T(2n-1,n) = a(A081267(n)) = 1,1,5,10,6,2,12,21,11,3,19,32,16,4,26,43,21...

Examples

			Triangular array begins:
  1
  1 2
  3 1 2
  4 2 1 3
  2 5 4 1 3
  2 5 6 3 1 4
Square array begins:
  1 1 3 4 2 2
  2 1 2 5 5 2
  2 1 4 6 3 2
  3 1 3 7 6 2
  3 1 5 8 4 2
  4 1 4 9 7 2
Row 5 of A239303 is the vector (12,18,1,17,10), which corresponds to the following binary matrix:
  0 0 1 1 0
  0 1 0 0 1
  1 0 0 0 0
  1 0 0 0 1
  0 1 0 1 0
Interpreted as an adjacency matrix it describes the following graph, where each number is connected to its neighbors, and only the 2 is connected to itself:
  2 5 4 1 3
This is row 5 of the triangular array.
		

Crossrefs

A116850 Number of permutations of length n which avoid the patterns 231, 12354.

Original entry on oeis.org

1, 2, 5, 14, 41, 119, 334, 902, 2351, 5945, 14660, 35408, 84061, 196715, 454778, 1040522, 2359451, 5308589, 11862208, 26345684, 58196201, 127926527, 279970070, 610271534, 1325400391, 2868904289, 6190793084, 13321109912, 28588376501, 61203284435, 130728067570
Offset: 1

Views

Author

Lara Pudwell, Feb 26 2006

Keywords

Comments

Inverse binomial transform (offset 0) is: 0, 1, 0, 2, 2, 6, 7, 12, 14, 20, 23, 30, 34, 42, 47, 56, 62, 72,.. with difference pattern +1, -1, +2, +0, +4, +1, +5, +2, +6, +3,... as in A168230. - R. J. Mathar, Feb 23 2013

Programs

  • PARI
    Vec(x*(1 - 7*x + 20*x^2 - 28*x^3 + 20*x^4 - 7*x^5) / ((1 - x)^3*(1 - 2*x)^3) + O(x^40)) \\ Colin Barker, Oct 30 2017

Formula

G.f.: x*(1 - 7*x + 20*x^2 - 28*x^3 + 20*x^4 - 7*x^5) / ((1 - x)^3*(1 - 2*x)^3).
From Colin Barker, Oct 30 2017: (Start)
a(n) = (1/16)*(32-9*2^(1+n) + (8+2^n)*n + (8+2^n)*n^2).
a(n) = 9*a(n-1) - 33*a(n-2) + 63*a(n-3) - 66*a(n-4) + 36*a(n-5) - 8*a(n-6) for n>6.
(End)

A195084 a(2n-1) = 2-n, a(2n) = 2+n.

Original entry on oeis.org

2, 1, 3, 0, 4, -1, 5, -2, 6, -3, 7, -4, 8, -5, 9, -6, 10, -7, 11, -8, 12, -9, 13, -10, 14, -11, 15, -12, 16, -13, 17, -14, 18, -15, 19, -16, 20, -17, 21, -18, 22, -19, 23, -20, 24, -21, 25, -22, 26, -23, 27, -24, 28, -25, 29, -26, 30, -27, 31, -28, 32, -29, 33
Offset: 0

Views

Author

Dave Durgin, Sep 08 2011

Keywords

Comments

Start with a(0)=2, subtract 1, add 2, subtract 3, add 4, subtract 5 and so on.
A permutation of all integers. - Ruud H.G. van Tol, Sep 21 2024

Crossrefs

Formula

From Bruno Berselli, Sep 12 2011: (Start)
G.f.: (2*x^2+3*x+2)/((1-x)*(1+x)^2).
a(n) = a(-n-1) = -((2*n+1)*a(n-1)-7*n)/(2*n-1) = -a(n-1)+a(n-2)+a(n-3).
a(n) = ((2*n+1)*(-1)^n+7)/4.
a(n) = 2 - A001057(n).
a(n)-a(n-1) = A038608(n); a(n)+a(n-1) = A010702(n-1).
Sum(n=1..n, a(i)) = ((n+1)*(-1)^n+7*n-1)/4, i.e. A016777 and A008586 (>0) alternately. (End)
a(n+2) = a(n) + (-1)^n. - Vincenzo Librandi, Sep 12 2011
E.g.f.: ((4 - x)*cosh(x) + (3 + x)*sinh(x))/2. - Stefano Spezia, Sep 22 2024

Extensions

Definition corrected by Omar E. Pol, Sep 11 2011
a(0)=2 prepended by Ruud H.G. van Tol, Sep 21 2024

A297996 a(1)=2, a(2)=3, a(3)=5 and a(n) = (a(1) + a(2) + a(3) + ... + a(n-1))/a(n-1).

Original entry on oeis.org

2, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 6, 10, 7, 11, 8, 12, 9, 13, 10, 14, 11, 15, 12, 16, 13, 17, 14, 18, 15, 19, 16, 20, 17, 21, 18, 22, 19, 23, 20, 24, 21, 25, 22, 26, 23, 27, 24, 28, 25, 29, 26, 30, 27, 31, 28, 32, 29, 33, 30, 34, 31, 35, 32, 36, 33, 37, 34, 38, 35
Offset: 1

Views

Author

Mateusz Pasternak, Jan 10 2018

Keywords

Crossrefs

Cf. A168230.

Programs

  • Mathematica
    Nest[Append[#, Total[#]/Last[#]] &, Prime@ Range@ 3, 67] (* Michael De Vlieger, Jan 10 2018 *)
    LinearRecurrence[{1,1,-1},{2,3,5,2,6},70] (* Harvey P. Dale, Dec 31 2021 *)
  • PARI
    lista(nn) = {va = vector(nn); for (n=1, 3, va[n] = prime(n)); for (n=4, nn, va[n] = sum(k=1, n-1, va[k])/va[n-1];); va;} \\ Michel Marcus, Jan 10 2018
    
  • PARI
    Vec(x*(2 + x - 4*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)) + O(x^100)) \\ Colin Barker, Jan 29 2018

Formula

a(n) = A168230(n+1) for n >= 3.
From Colin Barker, Jan 29 2018: (Start)
G.f.: x*(2 + x - 4*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)).
a(n) = n/2 for n>2 and even.
a(n) = (n+7)/2 for n>2 and odd.
a(n) = a(n-1) + a(n-2) - a(n-3) for n>5.
(End)

Extensions

More terms from Michel Marcus, Jan 10 2018

A376353 Table T(n, k) n > 0, k > 2 read by upward antidiagonals. The sequences in each column k is a triangle read by rows (blocks), where each row is a permutation of the numbers of its constituents. The length of the row number n in column k is equal to the n-th k-pyramidal number A261720.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Sep 21 2024

Keywords

Comments

A209278 presents an algorithm for generating permutations.
The sequence is an intra-block permutation of integer positive numbers.

Examples

			Table begins:
  k =      3   4   5   6   7   8
--------------------------------------
  n = 1:   1,  1,  1,  1,  1,  1, ...
  n = 2:   4,  4,  5,  5,  6,  6, ...
  n = 3:   3,  5,  4,  6,  5,  7, ...
  n = 4:   5,  3,  6,  4,  7,  5, ...
  n = 5:   2,  6,  3,  7,  4,  8, ...
  n = 6:  11,  2,  7,  3,  8,  4, ...
  n = 7:  10, 14,  2,  8,  3,  9, ...
  n = 8:  12, 13, 17,  2,  9,  3, ...
  n = 9:   9, 15, 16, 20,  2, 10, ...
  n = 10: 13, 12, 18, 19, 23,  2, ...
  n = 11:  8, 16, 15, 21, 22, 26, ...
  n = 12: 14, 11, 19, 18, 24, 25, ...
  n = 12:  7, 17, 14, 22, 21, 27, ...
  n = 14: 15, 10, 20, 17, 25, 24, ...
  n = 15:  6, 18, 13, 23, 20, 28, ...
          ... .
For k = 3 the first 3 blocks have lengths 1,4 and 10.
For k = 4 the first 2 blocks have lengths 1 and 5.
For k = 5 the first 2 blocks have lengths 1 and 6.
Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
   1;
   4, 1;
   3, 4, 1;
   5, 5, 5, 1;
   2, 3, 4, 5, 1;
  11, 6, 6, 6, 6, 1;
		

References

  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 93.

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,result},L=Ceiling[Max[x/.NSolve[(k-2)*x^4+2*k*x^3+(14-k)*x^2+(12-2*k)*x-24*n==0,x,Reals]]]; R=n-((k-2)*(L-1)^4+2*k*(L-1)^3+(14-k)*(L-1)^2+(12-2*k)*(L-1))/24; P=Which[OddQ[R]&&OddQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],((L^3*(k-2)+3*L^2-L*(k-5))/6+2-R)/2,OddQ[R]&&EvenQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],(R+(L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2,EvenQ[R]&&OddQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],Ceiling[((L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2]+R/2,EvenQ[R]&&EvenQ[(L^3*(k-2)+3*L^2-L*(k-5))/6],Ceiling[((L^3*(k-2)+3*L^2-L*(k-5))/6+1)/2]-R/2]; Res= P +((k-2)*(L-1)^4+2*k*(L-1)^3+(14-k)*(L-1)^2+(12-2*k)*(L-1))/24; result=Res] Nmax=6; Table[T[n,k],{n,1,Nmax},{k,3,Nmax+2}]

Formula

T(n,k) = P(n,k) + ((k-2)*(L(n,k)-1)^4+2*k*(L(n,k)-1)^3+(14-k)*(L(n,k)-1)^2+(12-2*k)*(L(n,k)-1))/24, where L(n,k) = ceiling(x(n,k)), x(n,k) is largest real root of the equation (k-2)*x^4+2*k*x^3+(14-k)*x^2+(12-2*k)*x-24*n = 0. R(n,k) = n - ((k-2)*(L(n,k)-1)^4+2*k*(L(n,k)-1)^3+(14-k)*(L(n,k)-1)^2+(12-2*k)*(L(n,k)-1))/24. P(n,k) = ((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+2-R(n,k))/2 if R(n,k) is odd and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is odd, P(n,k) = ((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)+R(n,k))/2 if R(n,k) is odd and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is even, P = ceiling(((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)/2)+R(n,k)/2) if R(n,k) is even and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is odd, P = ceiling(((L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6+1)/2)-R(n,k)/2) if R(n,k) is even and (L(n,k)^3*(k-2)+3*L(n,k)^2-L(n,k)*(k-5))/6 is even.
T(1,n) = A000012(n). T(2,n) = A004526(n+8). T(3,n) = A028242(n+7). T(4,n) = A084964(n+6). T(5,n) = A168230(n+5). T(n-2,n) = 4*A000012(n) for n > 3. T(n-1,n) = A000027(n) for n > 2.

A132169 Irregular triangle read by rows. A141616(n)/4.

Original entry on oeis.org

2, 3, 6, 4, 8, 5, 12, 10, 6, 15, 12, 7, 20, 18, 14, 8, 24, 21, 16, 9, 30, 28, 24, 18, 10, 35, 32, 27, 20, 11, 42, 40, 36, 30, 22, 12, 48, 45, 40, 33, 24, 13, 56, 54, 50, 44, 36, 26, 14, 63, 60, 55, 48, 39, 28, 15, 72, 70, 66, 60, 52, 42, 30, 16
Offset: 0

Views

Author

Paul Curtz, Aug 26 2008

Keywords

Comments

From Paul Curtz, Apr 14 2016: (Start)
Row sums: A023856.
Even rows: A120070.
Odd rows:
2,
6, 4,
12, 10, 6,
etc.
Divided by 2:
1,
3, 2,
6, 5, 3,
10, 9, 7, 4,
15, 14, 12, 9, 5,
etc.
This is A049777. Or positive A049780.
Also A271668 without the first column and bordered by the natural numbers as main diagonal.
(End)

Examples

			Irregular triangle:
2,
3,
6,   4,
8,   5,
12, 10, 6,
15, 12, 7,
20, 18, 14,  8,
24, 21, 16,  9,
30, 28, 24, 18, 10,
35, 32, 27, 20, 11,
etc.
		

Crossrefs

Programs

  • Mathematica
    (Table[n^2 - k^2, {n, 3, 18}, {k, n}] /. m_ /; Or[OddQ@ m, m == 0] -> Nothing)/4 // Flatten (* Michael De Vlieger, Apr 14 2016 *)

Extensions

Edited by Charles R Greathouse IV, Nov 11 2009

A266394 Square array a(n,k) is the number of terms in the "continued fraction" of the form -k1 + 1/(k2 - 1/(k3 -1/( ... for the fraction -k/n.

Original entry on oeis.org

1, 4, 2, 7, 1, 3, 10, 5, 5, 4, 13, 4, 1, 2, 5, 16, 8, 6, 8, 6, 6, 19, 7, 8, 1, 6, 3, 7, 22, 11, 4, 7, 11, 2, 7, 8, 25, 10, 9, 5, 1, 5, 9, 4, 9, 28, 14, 11, 11, 8, 14, 7, 7, 8, 10, 31, 13, 7, 4, 9, 1, 9, 2, 3, 5, 11, 34, 17, 12, 10, 9, 9, 17, 9, 12, 10, 9, 12
Offset: 1

Views

Author

Michel Marcus, Dec 29 2015

Keywords

Comments

a(n,k) is the number of steps to reach 0 for the fraction -k/n in the following process: if the fraction f is positive, it is replaced by 1/f; and if it is negative, it is replaced by f+1.

Examples

			a(1, 3) is the number of steps for -3/1: -3 -> -2 -> -1 -> 0 = 3 steps.
a(3, 1) is the number of steps for -1/3: -1/3 -> 2/3 -> -3/2 -> -1/2 -> 1/2 -> -2 -> -1 -> 0 = 7 steps.
The array begins:
   1, 2, 3, 4,  5, ...
   4, 1, 5, 2,  6, ...
   7, 5, 1, 8,  6, ...
  10, 4, 6, 1, 11, ...
  13, 8, 8, 7,  1, ...
  ...
		

Crossrefs

Cf. A000012 (diagonal), A016777 (1st column), A168230 (2nd line).

Programs

  • PARI
    trans(f) = if (f > 0, -1/f, if (f < 0, f+1, f));
    count(f) = nb = 0; while(f!=0, f = trans(f); nb++); nb;
    tabl(nn) = {for (n=1, nn, for (k=1, nn, print1(count(-k/n), ", ");); print(););}
Showing 1-8 of 8 results.