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 31-40 of 63 results. Next

A094761 a(n) = n + (square excess of n).

Original entry on oeis.org

0, 1, 3, 5, 4, 6, 8, 10, 12, 9, 11, 13, 15, 17, 19, 21, 16, 18, 20, 22, 24, 26, 28, 30, 32, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 64, 66, 68, 70, 72, 74, 76, 78
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2004

Keywords

Comments

The trajectory of n under iteration of m -> a(m) is eventually constant iff n is a perfect square.
Conjecture (verified up to 727): the numbers not in this sequence are those of A008865. - R. J. Mathar, Jan 23 2009
From Maon Wenders, Jul 01 2012: (Start)
Proof of conjecture:
(1) (n+2)^2 - n^2 = n^2 + 4n + 4 - n^2 = 4n + 4
(2) (n+1)^2 - n^2 = n^2 + 2n + 1 - n^2 = 2n + 1
(3) (n+1) + square excess of (n+1) - (n + square excess of n) = 2, except when (n+1) is a square, where a(n) collapses back to (n+1)
(4) so, cause of (2) and (3), the sequence has blocks of even and odd numbers starting with an even or odd square, m^2 and of length 2m+1:
0,
1, 3, 5,
4, 6, 8, 10, 12,
9, 11, 13, 15, 17, 19, 21,
16, 18, 20, 22, 24, 26, 28, 30, 32,
...
(5) such a block of 2m+1 numbers fills in all even or odd numbers between
n^2 and (n+2)^2
(6) but, because a block starts n^2 + 0, n^2 + 2, n^2 + 4, ..., the last number in such a block is n^2 + 2*(2n+1-1) = n^2 + 4n
(7) so the numbers n^2 + 4n + 2 = (n+2)^2 - 2 are missing.
End of proof. (End)

Crossrefs

Programs

Formula

a(n) = n + A053186(n).

A143054 A143052(A143052(n)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 20 2008

Keywords

Comments

Permutation of the natural numbers, inverse: A143053;
For n>1: a(A008865(n))=A000290(n),
a(A000290(n))=A000290(n)-A005408(n-2).

A160805 a(n) = (2*n^3 + 9*n^2 + n + 24) / 6.

Original entry on oeis.org

4, 6, 13, 27, 50, 84, 131, 193, 272, 370, 489, 631, 798, 992, 1215, 1469, 1756, 2078, 2437, 2835, 3274, 3756, 4283, 4857, 5480, 6154, 6881, 7663, 8502, 9400, 10359, 11381, 12468, 13622, 14845, 16139, 17506, 18948, 20467, 22065, 23744, 25506, 27353, 29287
Offset: 0

Views

Author

Reinhard Zumkeller, May 26 2009

Keywords

Comments

Arithmetic progression of third order; a(n+1)-a(n) = A008865(n+2);
a(n) = A101986(n) + 4.

References

  • R. Courant, Differential and Integral Calculus Vol. I (Blackie&Son, 1937), ch. I.4, Example 5, p.29.

Crossrefs

Programs

  • Magma
    [(2*n^3+9*n^2+n+24)/6: n in [0..50]]; // Vincenzo Librandi, Dec 27 2010
    
  • Maple
    A160805:=n->(2*n^3+9*n^2+n+24)/6: seq(A160805(n), n=0..80); # Wesley Ivan Hurt, Aug 29 2015
  • Mathematica
    Table[(2 n^3 + 9 n^2 + n + 24)/6, {n, 0, 60}]
    CoefficientList[Series[(4 - 10*x + 13*x^2 - 5*x^3)/(x - 1)^4, {x, 0, 60}], x] (* Wesley Ivan Hurt, Aug 29 2015 *)
  • PARI
    first(m)=vector(m,i,i--;(2*i^3 + 9*i^2 + i + 24) / 6) \\ Anders Hellström, Aug 29 2015

Formula

a(n) = (2*n^3 + 9*n^2 + n + 24) / 6.
From Wesley Ivan Hurt, Aug 29 2015: (Start)
G.f.: (4-10*x+13*x^2-5*x^3)/(x-1)^4.
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4), n>3. (End)

A213921 Natural numbers placed in table T(n,k) layer by layer. The order of placement: at the beginning filled odd places of layer clockwise, next - even places clockwise. Table T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 8, 9, 13, 17, 14, 6, 16, 21, 26, 22, 11, 12, 25, 31, 37, 32, 18, 15, 20, 36, 43, 50, 44, 27, 23, 24, 30, 49, 57, 65, 58, 38, 33, 19, 35, 42, 64, 73, 82, 74, 51, 45, 28, 29, 48, 56, 81, 91, 101, 92, 66, 59, 39, 34, 41, 63, 72, 100, 111
Offset: 1

Views

Author

Boris Putievskiy, Mar 05 2013

Keywords

Comments

A 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.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Enumeration table T(n,k) is layer by layer. The order of the list:
T(1,1)=1;
T(1,2), T(2,1), T(2,2);
. . .
T(1,n), T(3,n), ... T(n,3), T(n,1), T(2,n), T(4,n), ... T(n,4), T(n,2);
...

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   8  14  22  32 ...
   7   9   6  11  18  27 ...
  13  16  12  15  23  33 ...
  21  25  20  24  19  28 ...
  31  36  30  35  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  8,  9, 13;
  17, 14,  6, 16, 21;
  26, 22, 11, 12, 25, 31;
  ...
		

Crossrefs

Programs

  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if i > j:
       result=i*i-(j%2)*i+2-int((j+2)/2)
    else:
       result=j*j-((i%2)+1)*j + int((i+3)/2)

Formula

As a table:
T(n,k) = n*n - (k mod 2)*n + 2 - floor((k+2)/2), if n>k;
T(n,k) = k*k - ((n mod 2)+1)*k + floor((n+3)/2), if n<=k.
As a linear sequence:
a(n) = i*i - (j mod 2)*i + 2 - floor((j+2)/2), if i>j;
a(n) = j*j - ((i mod 2)+1)*j + floor((i+3)/2), if i<=j; where i = n-t*(t+1)/2, j = (t*t+3*t+4)/2-n, t = floor((-1+sqrt(8*n-7))/2).

A213922 Natural numbers placed in table T(n,k) layer by layer. The order of placement: T(n,n), T(n-1,n), T(n,n-1), ... T(1,n), T(n,1). Table T(n,k) read by antidiagonals.

Original entry on oeis.org

1, 3, 4, 8, 2, 9, 15, 6, 7, 16, 24, 13, 5, 14, 25, 35, 22, 11, 12, 23, 36, 48, 33, 20, 10, 21, 34, 49, 63, 46, 31, 18, 19, 32, 47, 64, 80, 61, 44, 29, 17, 30, 45, 62, 81, 99, 78, 59, 42, 27, 28, 43, 60, 79, 100, 120, 97, 76, 57, 40, 26, 41, 58, 77, 98, 121
Offset: 1

Views

Author

Boris Putievskiy, Mar 05 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.
Layer is pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). Enumeration table T(n,k) is layer by layer. The order of the list:
T(1,1)=1;
T(2,2), T(1,2), T(2,1);
...
T(n,n), T(n-1,n), T(n,n-1), ... T(1,n), T(n,1);
...

Examples

			The start of the sequence as a table:
   1,  3,  8, 15, 24, 35, ...
   4,  2,  6, 13, 22, 33, ...
   9,  7,  5, 11, 20, 31, ...
  16, 14, 12, 10, 18, 29, ...
  25, 23, 21, 19, 17, 27, ...
  36, 34, 32, 30, 28, 26, ...
...
The start of the sequence as triangular array read by rows:
   1;
   3,  4;
   8,  2,  9;
  15,  6,  7, 16;
  24, 13,  5, 14, 25;
  35, 22, 11, 12, 23, 36;
  ...
		

Crossrefs

Cf. A060734, A060736; table T(n,k) contains: in rows A005563, A028872, A028875, A028881, A028560, A116711; in columns A000290, A008865, A028347, A028878, A028884.

Programs

  • Mathematica
    f[n_, k_] := n^2 - 2*k + 2 /; n >= k; f[n_, k_] := k^2 - 2*n + 1 /; n < k; TableForm[Table[f[n, k], {n, 1, 5}, {k, 1, 10}]]; Table[f[n - k + 1, k], {n, 5}, {k, n, 1, -1}] // Flatten (* G. C. Greubel, Aug 19 2017 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if i >= j:
       result=i*i-2*j+2
    else:
       result=j*j-2*i+1

Formula

As a table,
T(n,k) = n*n - 2*k + 2, if n >= k;
T(n,k) = k*k - 2*n + 1, if n < k.
As a linear sequence,
a(n) = i*i - 2*j + 2, if i >= j;
a(n) = j*j - 2*i + 1, if i < j
where
i = n - t*(t+1)/2,
j = (t*t + 3*t + 4)/2 - n,
t = floor((-1 + sqrt(8*n-7))/2).

A228140 Numbers n such that n^2 - 2 is not squarefree.

Original entry on oeis.org

10, 39, 45, 58, 59, 88, 108, 116, 137, 156, 157, 186, 206, 235, 244, 255, 284, 304, 333, 334, 338, 353, 373, 382, 402, 414, 431, 451, 477, 480, 500, 529, 533, 549, 578, 598, 623, 627, 647, 665, 676, 685, 696, 717, 725, 745, 774, 794, 822, 823, 843, 845, 872, 892, 902, 912, 921, 941
Offset: 1

Views

Author

Gerasimov Sergey, Aug 12 2013

Keywords

Crossrefs

Programs

  • Maple
    remove(n -> numtheory:-issqrfree(n^2-2), [$1..1000]); # Robert Israel, Nov 03 2019
  • Mathematica
    Select[Range[1000],!SquareFreeQ[#^2-2]&] (* Harvey P. Dale, Jun 14 2021 *)

Formula

{n: A008865(n) in A013929} . - R. J. Mathar, Sep 26 2013

Extensions

Corrected by R. J. Mathar, Sep 26 2013

A299741 Array read by antidiagonals upwards: a(i,0) = 2, i >= 0; a(i,1) = i+2, i >= 0; a(i,j) = (i+2) * a(i,j-1) - a(i,j-2), for i >= 0, j > 1.

Original entry on oeis.org

2, 2, 2, 2, 3, 2, 2, 4, 7, 2, 2, 5, 14, 18, 2, 2, 6, 23, 52, 47, 2, 2, 7, 34, 110, 194, 123, 2, 2, 8, 47, 198, 527, 724, 322, 2, 2, 9, 62, 322, 1154, 2525, 2702, 843, 2, 2, 10, 79, 488, 2207, 6726, 12098, 10084, 2207, 2, 2, 11, 98, 702, 3842, 15127, 39202, 57965, 37634, 5778, 2
Offset: 0

Views

Author

William W. Collier, Feb 18 2018

Keywords

Comments

Note the similarity in form of the recursive steps in the array definition above and the polynomial definition under FORMULA.

Examples

			i\j |0  1   2    3      4       5        6          7           8            9
----+-------------------------------------------------------------------------
   0|2  2   2    2      2       2        2          2           2            2
   1|2  3   7   18     47     123      322        843        2207         5778
   2|2  4  14   52    194     724     2702      10084       37634       140452
   3|2  5  23  110    527    2525    12098      57965      277727      1330670
   4|2  6  34  198   1154    6726    39202     228486     1331714      7761798
   5|2  7  47  322   2207   15127   103682     710647     4870847     33385282
   6|2  8  62  488   3842   30248   238142    1874888    14760962    116212808
   7|2  9  79  702   6239   55449   492802    4379769    38925119    345946302
   8|2 10  98  970   9602   95050   940898    9313930    92198402    912670090
   9|2 11 119 1298  14159  154451  1684802   18378371   200477279   2186871698
  10|2 12 142 1692  20162  240252  2862862   34114092   406506242   4843960812
  11|2 13 167 2158  27887  360373  4656962   60180133   777684767  10049721838
  12|2 14 194 2702  37634  524174  7300802  101687054  1416317954  19726764302
  13|2 15 223 3330  49727  742575 11088898  165590895  2472774527  36926027010
  14|2 16 254 4048  64514 1028176 16386302  261152656  4162056194  66331746448
  15|2 17 287 4862  82367 1395377 23639042  400468337  6784322687 114933017342
  16|2 18 322 5778 103682 1860498 33385282  599074578 10749957122 192900153618
  17|2 19 359 6802 128879 2441899 46267202  876634939 16609796639 314709501202
  18|2 20 398 7940 158402 3160100 63043598 1257711860 25091193602 500566160180
  19|2 21 439 9198 192719 4037901 84603202 1772629341 37140612959 778180242798
		

Crossrefs

The array first appeared in A298675.
Rows 1 through 29 of the array appear in these OEIS entries: A005248, A003500, A003501, A003499, A056854, A086903, A056918, A087799, A057076, A087800, A078363, A067902, A078365, A090727, A078367, A087215, A078369, A090728, A090729, A090730, A090731, A090732, A090733, A090247, A090248, A090249, A090251. Also entries occur for rows 45, 121, and 320: A087265, A065705, A089775. Each of these entries asserts that a(i,j)=f(i+2,j) is true for that row.
A few of the columns appear in the OEIS: A008865 (for column 2), A058794 and A007754 (for column 3), and A230586 (for column 5).
Main diagonal gives A343261.

Programs

  • Maple
    A:= proc(i, j) option remember; `if`(min(i, j)=0, 2,
          `if`(j=1, i+2, (i+2)*A(i, j-1)-A(i, j-2)))
        end:
    seq(seq(A(d-k, k), k=0..d), d=0..12);  # Alois P. Heinz, Mar 05 2019
  • Mathematica
    a[, 0] = a[0, ] = 2; a[i_, 1] := i + 2;
    a[i_, j_] := a[i, j] =(i + 2) a[i, j - 1] - a[i, j - 2];
    Table[a[i - j, j], {i, 0, 10}, {j, 0, i}] // Flatten (* Jean-François Alcover, Dec 07 2019 *)

Formula

Let k be an integer, and let r1 and r2 be the roots of x + 1/x = k. Then f(k,n) = r1^n + r2^n is an integer, for integer n >= 0. Theorem: a(i,j) = f(i+2,j), for i,j >= 0. Proof: See the Collier link.
Define polynomials recursively by:
p[0](n) = 2, for n >= 0 ( [ and ] demark subscripts).
p[1](n) = n + 2, for n >= 0.
p[j](n) = p[j-1](n) * p[1](n) - p[j-2](n), for j > 1, n >= 0. The coefficients of these polynomials occur as the even numbered, upward diagonals in the OEIS Wiki link. Conjecture: a(i,j) = p[j](i), i,j >= 0.

Extensions

Edited by N. J. A. Sloane, Apr 04 2018

A060964 Table by antidiagonals where T(n,k) = n*T(n,k-1) - T(n,k-2) with T(n,0) = 2 and T(n,1) = n.

Original entry on oeis.org

2, 0, 2, -2, 1, 2, 0, -1, 2, 2, 2, -2, 2, 3, 2, 0, -1, 2, 7, 4, 2, -2, 1, 2, 18, 14, 5, 2, 0, 2, 2, 47, 52, 23, 6, 2, 2, 1, 2, 123, 194, 110, 34, 7, 2, 0, -1, 2, 322, 724, 527, 198, 47, 8, 2, -2, -2, 2, 843, 2702, 2525, 1154, 322, 62, 9, 2, 0, -1, 2, 2207, 10084, 12098, 6726, 2207, 488, 79, 10, 2
Offset: 0

Views

Author

Henry Bottomley, May 09 2001

Keywords

Examples

			Square array begins as:
  2, 0, -2,   0,   2,    0,    -2, ...
  2, 1, -1,  -2,  -1,    1,     2, ...
  2, 2,  2,   2,   2,    2,     2, ...
  2, 3,  7,  18,  47,  123,   322, ...
  2, 4, 14,  52, 194,  724,  2702, ...
  2, 5, 23, 110, 527, 2525, 12098, ...
		

Crossrefs

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return 2;
        elif k=1 then return n;
        else return n*T(n,k-1) - T(n,k-2);
        fi; end;
    Flat(List([0..12], n-> List([0..n], k-> T(k,n-k) ))); # G. C. Greubel, Jan 15 2020
  • Magma
    function T(n,k)
      if k eq 0 then return 2;
      elif k eq 1 then return n;
      else return n*T(n, k-1) - T(n, k-2);
      end if; return T; end function;
    [T(k,n-k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 15 2020
    
  • Maple
    seq(seq( simplify(k*ChebyshevU(n-k-1, k/2) -2*ChebyshevU(n-k-2, k/2)), k=0..n), n=0..12); # G. C. Greubel, Jan 15 2020
  • Mathematica
    Table[k*ChebyshevU[n-k-1, k/2] -2*ChebyshevU[n-k-2, k/2], {n,0,12}, {k,0,n} ]//Flatten
  • PARI
    T(n,k) = n*polchebyshev(k-1,2,n/2) -2*polchebyshev(k-2,2,n/2);
    for(n=0,12, for(k=0,n, print1(T(k,n-k), ", "))) \\ G. C. Greubel, Jan 15 2020
    
  • Sage
    [[k*chebyshev_U(n-k-1, k/2) -2*chebyshev_U(n-k-2, k/2) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jan 15 2020
    

Formula

For all m, T(n, k) = T(n, |m|)*T(n, |k - m|) - T(n, |k - 2m|).
T(n, 2k) = T(n, k)^2 - 2.
T(n, 2k + 1) = T(n, k)*T(n, k + 1) - n.
T(n, 3k) = T(n, k)^3 - 3*T(n, k).
T(n, 4k) = T(n, k)^4 - 4*T(n, k)^2 + 2.
T(n, 5k) = T(n, k)^5 - 5*T(n, k)^3 + 5*T(n, k) etc.
T(n, -k) = T(n, k).
T(-n, k) = T(-n, -k) = (-1)^k * T(n, k).
T(n, k) = ( n*( ((n + sqrt(n^2 -4))/2)^k - ((n - sqrt(n^2 -4))/2)^k ) - 2*( ((n + sqrt(n^2 -4))/2)^(k-1) - ((n - sqrt(n^2 -4))/2)^(k-1) ) )/sqrt(n^2 -4).
T(n, k) = n*ChebyshevU(k-1, n/2) - 2*ChebyshevU(k-2, n/2). - G. C. Greubel, Jan 15 2020

A101461 Row maximum of Catalan triangle with zeros (A053121), i.e., maximum value of (m+1)*binomial(n+1,(n-m)/2)/(n+1) for given n with m same parity as n.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 14, 28, 48, 90, 165, 297, 572, 1001, 2002, 3640, 7072, 13260, 25194, 48450, 90440, 177650, 326876, 653752, 1225785, 2414425, 4601610, 8947575, 17298645, 33266625, 65132550, 124062000, 245642760, 463991880, 927983760
Offset: 0

Views

Author

Henry Bottomley, Jan 20 2005

Keywords

Comments

There are two maximum values when n is of the form k^2 + 2k - 1 (i.e., 2 less than a square, A008865 offset) in which case m = k +/- 1. In general m is the integer with the same parity as n closest to sqrt(n+2) - 1.
The largest difference between adjacent binomial coefficients on n-th row of Pascal's triangle. - Vladimir Reshetnikov, Sep 16 2019

Programs

Formula

a(n) = (m+1)*binomial(n+1, (n-m)/2)/(n+1) where m = floor(sqrt(n+2) - (1 + (-1)^floor(n + sqrt(n+2) - 1))/2). a(n) seems to be slightly less than 2^n/n.

A144304 Square array A(n,m), n>=0, m>=0, read by antidiagonals: A(n,m) = n-th number of the m-th iteration of the hyperbinomial transform on sequence A001858.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 7, 7, 1, 4, 14, 38, 38, 1, 5, 23, 93, 291, 291, 1, 6, 34, 178, 822, 2932, 2932, 1, 7, 47, 299, 1763, 9193, 36961, 36961, 1, 8, 62, 462, 3270, 21504, 125292, 561948, 561948, 1, 9, 79, 673, 5523, 43135, 313585, 2022555, 10026505, 10026505, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 17 2008

Keywords

Examples

			Square array begins:
   1,   1,   1,    1,    1, ...
   1,   2,   3,    4,    5, ...
   2,   7,  14,   23,   34, ...
   7,  38,  93,  178,  299, ...
  38, 291, 822, 1763, 3270, ...
		

Crossrefs

Columns m=0-3 give: A001858, A001858(n+1), A089462, A089465.
Rows n=0-2 give: A000012, A000027, A008865(m+2).
Main diagonal gives A252727.

Programs

  • Maple
    hymtr:= proc(p) proc(n,m) `if`(m=0, p(n), m*add(p(k) *binomial(n, k) *(n-k+m)^(n-k-1), k=0..n)) end end: f:= proc(n) option remember; add(add(binomial(m, j) *binomial(n-1, n-m-j) *n^(n-m-j) *(m+j)!/ (-2)^j/ m!, j=0..m), m=0..n) end: A:= hymtr(f): seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    hymtr[p_] := Function[{n, m}, If[m == 0, p[n], m*Sum[p[k]*Binomial[n, k]*(n-k+m)^(n-k-1), {k, 0, n}]]]; f[0] = 1; f[n_] := f[n] = Sum[Sum[Binomial[m, j]*Binomial[n-1, n-m-j]*n^(n-m-j)*(m+j)!/(-2)^j/m!, {j, 0, m}], {m, 0, n}]; A[0, ] = 1; A[1, k] := k+1; A[n_, m_] := hymtr[f][n, m]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Dec 27 2013, translated from Maple *)
Previous Showing 31-40 of 63 results. Next