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 11-20 of 35 results. Next

A162917 Numbers n which are not in A161983.

Original entry on oeis.org

1, 2, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 28, 29, 30, 31, 32, 33, 34, 35, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 120, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 17 2009

Keywords

Comments

They have a block structure: A000384(n) is followed by the next n integers.
Numbers k with the property that the largest Dyck path of the symmetric representation of sigma(k) has a central peak. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
Union of nonzero terms of A000384 and A317303. - Omar E. Pol, Aug 29 2018

Examples

			From _Omar E. Pol_, Aug 28 2018: (Start)
Also, written as an irregular triangle in which the row lengths are the positive even numbers, the sequence begins:
   1,  2;
   6,  7,  8,  9;
  15, 16, 17, 18, 19, 20;
  28, 29, 30, 31, 32, 33, 34, 35;
  45, 46, 47, 48, 49, 50, 51, 52, 53,  54;
  66, 67, 68, 69, 70, 71, 72, 73, 74,  75,  76,  77;
  91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104;
...
Row sums give A035328, n >= 1.
Column 1 gives A000384, n >= 1.
Column 2 gives A130883, n >= 1.
Right border gives the positive terms of A014107, also the odd-indexed terms of A000096.
(End)
		

Crossrefs

Formula

Extensions

119 removed by R. J. Mathar, Jul 19 2009

A185869 (Odd,even)-polka dot array in the natural number array A000027; read by antidiagonals.

Original entry on oeis.org

2, 7, 9, 16, 18, 20, 29, 31, 33, 35, 46, 48, 50, 52, 54, 67, 69, 71, 73, 75, 77, 92, 94, 96, 98, 100, 102, 104, 121, 123, 125, 127, 129, 131, 133, 135, 154, 156, 158, 160, 162, 164, 166, 168, 170, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 379, 381, 383, 385, 387, 389, 391, 393, 395, 397, 399, 401, 403, 405
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2011

Keywords

Comments

This is the second of four polka dot arrays; see A185868.
row 1: A130883;
row 2: A100037;
row 3: A100038;
row 4: A100039;
col 1: A014107;
col 2: A033537;
col 3: A100040;
col 4: A100041;
diag (2,18,...): A077591;
diag (7,31,...): A157914;
diag (16,48,...): A035008;
diag (29,69,...): A108928;
antidiagonal sums: A033431;
antidiagonal sums: 2*(1^3, 2^3, 3^3, 4^3,...) = 2*A000578.
A060432(n) + n is odd if and only if n is in this sequence. - Peter Kagey, Feb 03 2016

Examples

			Northwest corner:
  2....7....16...29...46
  9....18...31...48...69
  20...33...50...71...96
  35...52...73...98...127
		

Crossrefs

Cf. A000027 (as an array), A060432, A185868, A185870, A185871.

Programs

  • Haskell
    a185869 n = a185869_list !! (n - 1)
    a185869_list = scanl (+) 2 $ a' 1
      where  a' n = 2 * n + 3 : replicate n 2 ++ a' (n + 1)
    -- Peter Kagey, Sep 02 2016
    
  • Mathematica
    f[n_,k_]:=2n-1+(2n+2k-3)(n+k-1);
    TableForm[Table[f[n,k],{n,1,10},{k,1,15}]]
    Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten
  • Python
    from math import isqrt, comb
    def A185869(n):
        a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
        x = n-comb(a,2)
        y = a-x+1
        return y*((y+(c:=x<<1)<<1)-5)+x*(c-3)+2 # Chai Wah Wu, Jun 18 2025

Formula

T(n,k) = 2n-1+(n+k-1)*(2n+2k-3), k>=1, n>=1.

A285790 Primes equal to a hexagonal number plus 1.

Original entry on oeis.org

2, 7, 29, 67, 191, 277, 379, 631, 947, 1129, 1327, 2017, 2557, 2851, 4561, 4951, 5779, 6217, 8647, 9181, 12721, 13367, 14029, 15401, 16111, 17579, 20707, 21529, 22367, 24091, 24977, 31627, 36857, 37951, 42487, 43661, 44851, 47279, 53629, 58997, 64621, 66067
Offset: 1

Views

Author

Colin Barker, Apr 26 2017

Keywords

Comments

Apart from the leading 2 the same as A176616. - R. J. Mathar, Apr 27 2017
Primes in A130883. - Omar E. Pol, Apr 27 2017

Crossrefs

Programs

  • Mathematica
    Select[PolygonalNumber[6,Range[200]]+1,PrimeQ] (* Harvey P. Dale, Jun 16 2022 *)
  • PARI
    pg(m, n) = (n^2*(m-2)-n*(m-4))/2 \\ n-th m-gonal number
    maxk=300; L=List(); for(k=1, maxk, if(isprime(p=pg(6, k) + 1), listput(L, p))); Vec(L)

A128218 First differences of A128217.

Original entry on oeis.org

1, 3, 1, 3, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

John W. Layman, Feb 19 2007

Keywords

Comments

a(A130883(n-1)) = 2*n-1 and a(m) != 2*n-1 for m < A130883(n-1). - Reinhard Zumkeller, Jun 20 2015

Crossrefs

Cf. A128127.
Cf. A130883, A152271 (run lengths after initial term).

Programs

  • Haskell
    a128218 n = a128218_list !! (n-1)
    a128218_list = zipWith (-) (tail a128217_list) a128217_list
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Mathematica
    nsrQ[n_]:=Module[{sr=Sqrt[n]},Abs[First[sr-Nearest[{Floor[sr], Ceiling[ sr]}, sr]]]<1/4];Differences[Select[Range[0,250],nsrQ]] (* Harvey P. Dale, May 02 2012 *)
  • PARI
    default(realprecision, 10000);
    is_A128217(n) = ((abs(sqrt(n)-sqrtint(n))<(1/4)) || (abs(sqrt(n)-(1+sqrtint(n)))<(1/4)));
    k=0; n=0; prevm=0; while(k<20000, n++; if(is_A128217(n), k++; write("b128218.txt", k, " ", (n-prevm)); prevm = n)); \\ Antti Karttunen, Jan 16 2025

Formula

Let A(1)={1}. Then, for k=2,3,4,..., form A(k) by appending to A(k-1) the term k-1 followed by k-1 1's, if k is even, or by appending to A(k-1) the term k followed by k-1 1's, if k is odd. {a(n)} appears to be the limit of {A(k)} as k->infinity.

Extensions

Offset changed by Reinhard Zumkeller, Jun 20 2015

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

Original entry on oeis.org

1, 2, 8, 19, 35, 56, 82, 113, 149, 190, 236, 287, 343, 404, 470, 541, 617, 698, 784, 875, 971, 1072, 1178, 1289, 1405, 1526, 1652, 1783, 1919, 2060, 2206, 2357, 2513, 2674, 2840, 3011, 3187, 3368, 3554, 3745, 3941, 4142, 4348, 4559, 4775, 4996, 5222, 5453, 5689
Offset: 0

Views

Author

Eric Werley, Jun 24 2011

Keywords

Comments

Binomial transform of [1, 1, 5, 0, 0, 0, 0, 0, ...]. - Johannes W. Meijer, Jul 07 2011

Crossrefs

Programs

Formula

a(n) = (5*n^2 - 3*n + 2)/2.
a(n) = 2*a(n-1) - a(n-2) + 5.
a(n) = a(n-1) + 5*n - 4.
a(n) = 5*binomial(n+2,2) - 9*n - 4.
a(n) = A000217(n+1) - A000217(n) + 5*A000217(n-1); triangular numbers. - Johannes W. Meijer, Jul 07 2011
O.g.f.: (1-x+5*x^2)/(1-x)^3.
From Elmo R. Oliveira, Nov 16 2024: (Start)
E.g.f.: exp(x)*(2 + 2*x + 5*x^2)/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A211394 T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

1, 5, 6, 2, 3, 4, 12, 13, 14, 15, 7, 8, 9, 10, 11, 23, 24, 25, 26, 27, 28, 16, 17, 18, 19, 20, 21, 22, 38, 39, 40, 41, 42, 43, 44, 45, 29, 30, 31, 32, 33, 34, 35, 36, 37, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 80
Offset: 1

Views

Author

Boris Putievskiy, Feb 08 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(1,3), T(2,2), T(3,1);
T(1,2), T(2,1);
. . .
T(1,n), T(2,n-1), T(3,n-2), ... T(n,1);
T(1,n-1), T(2,n-3), T(3,n-4),...T(n-1,1);
. . .
First row matches with the elements antidiagonal {T(1,n), ... T(n,1)},
second row matches with the elements antidiagonal {T(1,n-1), ... T(n-1,1)}.
Table contains:
row 1 is alternation of elements A130883 and A096376,
row 2 accommodates elements A033816 in even places,
row 3 accommodates elements A100037 in odd places,
row 5 accommodates elements A100038 in odd places;
column 1 is alternation of elements A084849 and A000384,
column 2 is alternation of elements A014106 and A014105,
column 3 is alternation of elements A014107 and A091823,
column 4 is alternation of elements A071355 and |A168244|,
column 5 accommodates elements A033537 in even places,
column 7 is alternation of elements A100040 and A130861,
column 9 accommodates elements A100041 in even places;
the main diagonal is A058331,
diagonal 1, located above the main diagonal is A001844,
diagonal 2, located above the main diagonal is A001105,
diagonal 3, located above the main diagonal is A046092,
diagonal 4, located above the main diagonal is A056220,
diagonal 5, located above the main diagonal is A142463,
diagonal 6, located above the main diagonal is A054000,
diagonal 7, located above the main diagonal is A090288,
diagonal 9, located above the main diagonal is A059993,
diagonal 10, located above the main diagonal is |A147973|,
diagonal 11, located above the main diagonal is A139570;
diagonal 1, located under the main diagonal is A051890,
diagonal 2, located under the main diagonal is A005893,
diagonal 3, located under the main diagonal is A097080,
diagonal 4, located under the main diagonal is A093328,
diagonal 5, located under the main diagonal is A137882.

Examples

			The start of the sequence as table:
  1....5...2..12...7..23..16...
  6....3..13...8..24..17..39...
  4...14...9..25..18..40..31...
  15..10..26..19..41..32..60...
  11..27..20..42..33..61..50...
  28..21..43..34..62..51..85...
  22..44..35..63..52..86..73...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  5,6;
  2,3,4;
  12,13,14,15;
  7,8,9,10,11;
  23,24,25,26,27,28;
  16,17,18,19,20,21,22;
  . . .
Row number r matches with r numbers segment {(r+1)*r/2-r*(-1)^(r+1)-r+2,... (r+1)*r/2-r*(-1)^(r+1)+1}.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := (n+k)(n+k-1)/2 - (-1)^(n+k)(n+k-1) - k + 2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    j=(t*t+3*t+4)/2-n
    result=(t+2)*(t+1)/2-(t+1)*(-1)**t-j+2

Formula

T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2.
As linear sequence
a(n) = A003057(n)*A002024(n)/2- A002024(n)*(-1)^A003056(n)-A004736(n)+2.
a(n) = (t+2)*(t+1)/2 - (t+1)*(-1)^t-j+2, where j=(t*t+3*t+4)/2-n and t=int((math.sqrt(8*n-7) - 1)/ 2).

A213171 T(n,k) = ((k+n)^2 - 4*k + 3 - (-1)^n - (k+n)*(-1)^(k+n))/2; n, k > 0, read by antidiagonals.

Original entry on oeis.org

1, 4, 5, 2, 3, 6, 9, 10, 13, 14, 7, 8, 11, 12, 15, 18, 19, 22, 23, 26, 27, 16, 17, 20, 21, 24, 25, 28, 31, 32, 35, 36, 39, 40, 43, 44, 29, 30, 33, 34, 37, 38, 41, 42, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 46, 47, 50, 51, 54, 55, 58, 59, 62, 63, 66, 69
Offset: 1

Views

Author

Boris Putievskiy, Feb 14 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1) = 1;
T(1,3), T(2,2), T(1,2), T(2,1), T(3,1);
. . .
T(1,n), T(2,n-1), T(1,n-1), T(2,n-2), T(3,n-2), T(4,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonals - step to the southwest, step to the north, step to the southwest, step to the south and so on. The length of each step is 1. Phase four steps is rotated 90 degrees counterclockwise and the mirror of the phase A211377.
Table contains the following:
row 1 is alternation of elements A130883 and A100037,
row 2 accommodates elements A033816 in even places;
column 1 is alternation of elements A000384 and A014106,
column 2 is alternation of elements A091823 and A071355,
column 4 accommodates elements A130861 in odd places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal, accommodates elements A033585 in even places,
diagonal 2, located above the main diagonal, accommodates elements A139271 in odd places,
diagonal 3, located above the main diagonal, is alternation of elements A033566 and A194431.

Examples

			The start of the sequence as a table:
   1   4   2   9   7   8  16 ...
   5   3  10   8  19  17  32 ...
   6  13  11  22  20  35  33 ...
  14  12  23  21  36  34  53 ...
  15  26  24  39  37  56  54 ...
  27  25  40  38  57  55  78 ...
  28  43  41  60  58  81  79 ...
  ...
The start of the sequence as a triangle array read by rows:
   1
   4  5
   2  3  6
   9 10 13 14
   7  8 11 12 15
  18 19 22 23 26 27
  16 17 20 21 24 25 28
  ...
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of triangle array, located above.
Last 2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
   1
   4  5  2  3  6
   9 10 13 14  7  8 11 12 15
  18 19 22 23 26 27 16 17 20 21 24 25 28
  ...
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+6, 2*r*r-5*r+7, ..., 2*r*r-r-4, 2*r*r-r-3, 2*r*r-r.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((k+n)^2-4*k+3-(-1)^n-(k+n)*(-1)^(k+n))/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 - (-1)^n - (-1)^(n+k)(n+k))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3-(-1)**i-(t+2)*(-1)**t)/2

Formula

As a table:
T(n,k) = ((k+n)^2-4*k+3-(-1)^n-(k+n)*(-1)^(k+n))/2.
As a linear sequence:
a(n) = (A003057(n)^2-4*A004736(n)+3-(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3-(-1)^i-(t+2)*(-1)^t)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A213197 T(n,k) = (2*(n+k)^2 - 2*(n+k) - 4*k + 6 + (2*k-2)*(-1)^n + (2*k-1)*(-1)^k + (-2*n+1)*(-1)^(n+k))/4; n, k > 0, read by antidiagonals.

Original entry on oeis.org

1, 3, 4, 2, 6, 5, 8, 9, 11, 12, 7, 15, 10, 14, 13, 17, 18, 20, 21, 23, 24, 16, 28, 19, 27, 22, 26, 25, 30, 31, 33, 34, 36, 37, 39, 40, 29, 45, 32, 44, 35, 43, 38, 42, 41, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 46, 66, 49, 65, 52, 64, 55, 63, 58, 62, 61, 68
Offset: 1

Views

Author

Boris Putievskiy, Mar 01 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(3,1), T(2,2), T(1,3);
T(2,1), T(1,2);
...
T(1,2*m+1), T(1,2*m), T(2, 2*m-1), T(3, 2*m-1),... T(2*m,1), T(2*m+1,1);
T(2*m,2), T(2*m-2,4), ...T(2,2*m);
...
Movement along two adjacent antidiagonals. The first row consists of phases: step to the west, step to the southwest, step to the south. The second row consists of phases: 2 steps to the north, 2 steps to the east. The length of each step is 1.

Examples

			The start of the sequence as a table:
   1,  3,  2,  8,  7, 17, 16, ...
   4,  6,  9, 15, 18, 28, 31, ...
   5, 11, 10, 20, 19, 33, 32, ...
  12, 14, 21, 27, 34, 44, 51, ...
  13, 23, 22, 36, 35, 53, 52, ...
  24, 26, 37, 43, 54, 64, 75, ...
  25, 39, 38, 56, 55, 77, 76, ...
  ...
The start of the sequence as a triangular array read by rows:
   1;
   3,  4;
   2,  6,  5;
   8,  9, 11, 12;
   7, 15, 10, 14, 13;
  17, 18, 20, 21, 23, 24;
  16, 28, 19, 27, 22, 26, 25;
  ...
The start of the sequence as an array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from row 2*r-2 of the triangular array above.
Last  2*r-1 numbers are from row 2*r-1 of the triangular array above.
   1;
   3,  4,  2,  6,  5;
   8,  9, 11, 12,  7, 15, 10, 14, 13;
  17, 18, 20, 21, 23, 24, 16, 28, 19, 27, 22, 26, 25;
  ...
Row r contains permutation of 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+5, 2*r*r-5*r+6, ..., 2*r*r-2*r+2, 2*r*r-2*r+1.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->(2*(n+k)^2-2*(n+k)-4*k+6+(2*k-2)*(-1)^n+(2*k-1)*(-1)^k+(1-+2*n)*(-1)^(n+k))/4: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := (2(n+k)^2 - 2(n+k) - 4k + 6 + (2k-2)(-1)^n + (2k-1)(-1)^k + (-2n+1)(-1)^(n+k))/4;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=(2*(t+2)**2-2*(t+2)-4*j+6 +(2*j-2)*(-1)**i+(2*j-1)*(-1)**j+(-2*i+1)*(-1)**t)/4

Formula

As a table:
T(n,k) = (2*(n+k)^2 - 2*(n+k) - 4*k + 6 + (2*k-2)*(-1)^n + (2*k-1)*(-1)^k + (-2*n+1)*(-1)^(n+k))/4.
As a linear sequence:
a(n) = (2*A003057(n)^2 - 2*A003057(n) - 4*A004736(n) + 6 + (2*A004736(n)-2)*(-1)^A002260(n) + (2*A004736(n)-1)*(-1)^A004736(n) + (-2*A002260(n)+1)*(-1)^A003056(n))/4;
a(n) = (2*(t+2)^2 - 2*(t+2) - 4*j + 6 + (2*j-2)*(-1)^i + (2*j-1)*(-1)^j + (-2*i+1)*(-1)^t)/4, where i = n - t*(t+1)/2, j = (t*t + 3*t + 4)/2 - n, t = floor((-1+sqrt(8*n-7))/2).

A213205 T(n,k) = ((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

1, 5, 4, 2, 3, 6, 10, 9, 14, 13, 7, 8, 11, 12, 15, 19, 18, 23, 22, 27, 26, 16, 17, 20, 21, 24, 25, 28, 32, 31, 36, 35, 40, 39, 44, 43, 29, 30, 33, 34, 37, 38, 41, 42, 45, 49, 48, 53, 52, 57, 56, 61, 60, 65, 64, 46, 47, 50, 51, 54, 55, 58, 59, 62, 63, 66, 70
Offset: 1

Views

Author

Boris Putievskiy, Feb 15 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(1,3), T(2,2), T(2,1), T(1,2), T(3,1);
. . .
T(1,2*n+1), T(2,2*n), T(2,2*n-1), T(1,2*n), ...T(2*n-1,3), T(2*n,2), T(2*n,1), T(2*n-1,2), T(2*n+1,1);
. . .
Movement along two adjacent antidiagonals - step to the southwest, step to the west, step to the northeast, 2 steps to the south, step to the west and so on. The length of each step is 1.
Table contains:
row 1 accommodates elements A130883 in odd places,
row 2 is alternation of elements A100037 and A033816;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A014106 and A071355,
column 3 accommodates elements A130861 in even places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal accommodates elements A033566 in even places,
diagonal 2, located above the main diagonal is alternation of elements A139271 and A024847,
diagonal 3, located above the main diagonal accommodates of elements A033585.

Examples

			The start of the sequence as table:
1....5...2..10...7..19..16...
4....3...9...8..18..17..31...
6...14..11..23..20..36..33...
13..12..22..21..35..34..52...
15..27..24..40..37..57..54...
26..25..39..38..56..55..77...
28..44..41..61..58..82..79...
. . .
The start of the sequence as triangle array read by rows:
1;
5,4;
2,3,6;
10,9,14,13;
7,8,11,12,15;
19,18,23,22,27,26;
16,17,20,21,24,25,28;
. . .
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of  triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of  triangle array, located above.
1;
5,4,2,3,6;
10,9,14,13,7,8,11,12,15;
19,18,23,22,27,26,16,17,20,21,24,25,28;
. . .
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+7, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-3, 2*r*r-r.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 + (-1)^k - 2(-1)^n - (n+k)(-1)^(n+k))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3+(-1)**j-2*(-1)**i-(t+2)*(-1)**t)/2

Formula

As table
T(n,k) = ((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2.
As linear sequence
a(n) = (A003057(n)^2-4*A004736(n)+3+(-1)^A004736(n)-2*(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3+(-1)^j-2*(-1)^i-(t+2)*(-1)^t)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A354008 Numerators of Cesàro means sequence of A114112.

Original entry on oeis.org

1, 3, 7, 5, 16, 7, 29, 9, 46, 11, 67, 13, 92, 15, 121, 17, 154, 19, 191, 21, 232, 23, 277, 25, 326, 27, 379, 29, 436, 31, 497, 33, 562, 35, 631, 37, 704, 39, 781, 41, 862, 43, 947, 45, 1036, 47, 1129, 49, 1226, 51, 1327, 53, 1432, 55, 1541, 57, 1654, 59, 1771, 61, 1892, 63, 2017, 65
Offset: 1

Views

Author

Bernard Schott, May 13 2022

Keywords

Comments

This sequence lists the numerators of c(n) = (Sum_{k=1..n} A114112(k)) / n. The corresponding denominator is A141310(n-1) (see Example section).
When a sequence u(n) is increasing, then Cesàro means sequence c(n) = (u(1)+...+u(n))/n is also increasing, but the converse is false.
A114112 is such a counterexample.
Proof: A114112 is clearly not increasing; now, the successive arithmetic means c(n) of the first specific terms of the sequence are 1/1, 3/2, 7/3, 10/4, 16/5, 21/6, 29/7, ... so, if m >= 1, c(2m) = (2m+1)/2 and c(2m+1) = m+1 + 1/(2m+1), c(1) = 1. We get c(n) = a(n) / A141310(n-1) for n >= 1.
We have c(2m+1) - c(2m) = 1/(2m+1) + 1/2 > 0 and c(2m+2) - c(2m+1) = (2m-1) / (4m+2) > 0 when m >= 1; hence for m >= 1, c(2m) < c(2m+1) < c(2m+2), and also c(1) = 1 < c(2) = 3/2; QED.

Examples

			Table with the first few terms:
       Indices n        :  1,   2,   3,   4,    5,   6,    7,   8,    9,   10, ...
       A114112(n)       :  1,   2,   4,   3,    6,   5,    8,   7,   10,    9, ...
      Partial sums      :  1,   3,   7,  10,   16,  21,   29,  36,   46,   55, ...
    Cesàro means c(n)   :  1, 3/2, 7/3, 5/2, 16/5, 7/2, 29/7, 9/2, 46/9, 11/2, ...
      Numerator a(n)    :  1,   3,   7,   5,   16,   7,   29,   9,   46,   11, ...
Denominator A141310(n-1):  1,   2,   3,   2,    5,   2,    7,   2,    9,    2, ...
		

References

  • J. M. Arnaudiès, P. Delezoide et H. Fraysse, Exercices résolus d'Analyse du cours de mathématiques - 2, Dunod, Exercice 10, pp. 14-16.

Crossrefs

Programs

  • Mathematica
    s[1] = 1; s[2] = 2; s[n_] := If[OddQ[n], n + 1, n - 1]; m = 100; Numerator[Accumulate[Array[s, m]]/Range[m]] (* Amiram Eldar, May 15 2022 *)
  • PARI
    f(n) = if (n<=2, n, if (n%2, n+1, n-1)); \\ A114112
    a(n) = numerator(sum(k=1, n, f(k))/n); \\ Michel Marcus, May 16 2022
    
  • Python
    from math import gcd
    def A354008(n): return 1 if n == 1 else (k:= (m:=n//2)*(n+1) + (n+1-m)*(n-2*m))//gcd(k,n) # Chai Wah Wu, May 24 2022

Formula

a(1) = 1, then for m >= 1: a(2m+1) = A130883(m+1) and a(2m) = A005408(m) = 2m+1.
G.f.: x*(1 + 3*x + 4*x^2 - 4*x^3 - 2*x^4 + x^5 + x^6)/(1 - x^2)^3. - Stefano Spezia, May 15 2022
Previous Showing 11-20 of 35 results. Next