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

A214858 Natural numbers missing from A214857.

Original entry on oeis.org

5, 8, 12, 15, 19, 22, 26, 29, 32, 36, 39, 43, 46, 49, 53, 56, 60, 63, 67, 70, 73, 77, 80, 84, 87, 90, 94, 97, 101, 104, 108, 111, 114, 118, 121, 125, 128, 131, 135, 138, 142, 145, 149, 152, 155, 159, 162, 166, 169, 172, 176, 179, 183, 186, 189, 193, 196, 200
Offset: 1

Views

Author

Philippe Deléham, Mar 09 2013

Keywords

Crossrefs

Programs

Formula

a(n+1) - a(n) = 3 or 4.

Extensions

Extended by T. D. Noe, Mar 11 2013

A281871 Number T(n,k) of k-element subsets of [n] having a square element sum; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 2, 0, 0, 1, 2, 3, 3, 2, 1, 0, 1, 2, 4, 5, 5, 2, 1, 0, 1, 2, 5, 8, 8, 6, 3, 0, 1, 1, 3, 6, 11, 14, 13, 7, 4, 1, 0, 1, 3, 7, 15, 23, 24, 19, 10, 3, 1, 0, 1, 3, 8, 20, 34, 43, 39, 25, 13, 3, 1, 0, 1, 3, 9, 26, 49, 71, 74, 60, 34, 14, 5, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Jan 31 2017

Keywords

Examples

			T(7,0) = 1: {}.
T(7,1) = 2: {1}, {4}.
T(7,2) = 4: {1,3}, {2,7}, {3,6}, {4,5}.
T(7,3) = 5: {1,2,6}, {1,3,5}, {2,3,4}, {3,6,7}, {4,5,7}.
T(7,4) = 5: {1,2,6,7}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7}, {2,3,5,6}.
T(7,5) = 2: {1,2,3,4,6}, {3,4,5,6,7}.
T(7,6) = 1: {1,2,4,5,6,7}.
T(7,7) = 0.
T(8,8) = 1: {1,2,3,4,5,6,7,8}.
Triangle T(n,k) begins:
  1;
  1, 1;
  1, 1, 0;
  1, 1, 1,  0;
  1, 2, 1,  1,  0;
  1, 2, 2,  2,  0,  0;
  1, 2, 3,  3,  2,  1,  0;
  1, 2, 4,  5,  5,  2,  1,  0;
  1, 2, 5,  8,  8,  6,  3,  0,  1;
  1, 3, 6, 11, 14, 13,  7,  4,  1,  0;
  1, 3, 7, 15, 23, 24, 19, 10,  3,  1, 0;
  1, 3, 8, 20, 34, 43, 39, 25, 13,  3, 1, 0;
  1, 3, 9, 26, 49, 71, 74, 60, 34, 14, 5, 0, 0;
  ...
		

Crossrefs

Main diagonal is characteristic function of A001108.
Diagonals T(n+k,n) for k=2-10 give: A281965, A281966, A281967, A281968, A281969, A281970, A281971, A281972, A281973.
Row sums give A126024.
T(2n,n) gives A281872.

Programs

  • Maple
    b:= proc(n, s) option remember; expand(`if`(n=0,
          `if`(issqr(s), 1, 0), b(n-1, s)+x*b(n-1, s+n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..16);
  • Mathematica
    b[n_, s_] := b[n, s] = Expand[If[n == 0, If[IntegerQ @ Sqrt[s], 1, 0], b[n - 1, s] + x*b[n - 1, s + n]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, 0]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jun 03 2018, from Maple *)

Formula

T(n,n) = 1 for n in { A001108 }, T(n,n) = 0 otherwise.
T(n,n-1) = 1 for n in { A214857 }, T(n,n-1) = 0 for n in { A214858 }.
Sum_{k=0..n} k * T(n,k) = A377572(n).

A214856 Number of triangular numbers in interval ](n-1)^2, n^2] for n>0, a(0)=1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1
Offset: 0

Views

Author

Philippe Deléham, Mar 08 2013

Keywords

Examples

			10, 15 are in interval ]9, 16] , a(4) = 2.
		

Crossrefs

Programs

  • PARI
    a(n) = if (n, sum(i=(n-1)^2+1, n^2, ispolygonal(i, 3)), 1); \\ Michel Marcus, Nov 12 2022
    
  • Python
    from math import isqrt
    def A214856(n): return (isqrt((m:=n**2<<3)+8)+1>>1)-(isqrt(m-(n-1<<4))+1>>1) if n else 1 # Chai Wah Wu, Dec 09 2024

A214859 Triangle read by rows, T(n,k) = n^2 - k*(k+1)/2 if k*(k+1)/2 <= n^2.

Original entry on oeis.org

0, 1, 0, 4, 3, 1, 9, 8, 6, 3, 16, 15, 13, 10, 6, 1, 25, 24, 22, 19, 15, 10, 4, 36, 35, 33, 30, 26, 21, 15, 8, 0, 49, 48, 46, 43, 39, 34, 28, 21, 13, 4, 64, 63, 61, 58, 54, 49, 43, 36, 28, 19, 9, 81, 80, 78, 75, 71, 66, 60, 53, 45, 36, 26, 15, 3, 100, 99, 97
Offset: 0

Views

Author

Philippe Deléham, Mar 09 2013

Keywords

Comments

Row lengths are in A214857.

Examples

			Triangle begins:
    0;
    1,   0;
    4,   3,   1;
    9,   8,   6,   3;
   16,  15,  13,  10,   6,   1;
   25,  24,  22,  19,  15,  10,   4;
   36,  35,  33,  30,  26,  21,  15,  8,  0;
   49,  48,  46,  43,  39,  34,  28, 21, 13,  4;
   64,  63,  61,  58,  54,  49,  43, 36, 28, 19,  9;
   81,  80,  78,  75,  71,  66,  60, 53, 45, 36, 26, 15,  3;
  100,  99,  97,  94,  90,  85,  79, 72, 64, 55, 45, 34, 22,  9;
  121, 120, 118, 115, 111, 106, 100, 93, 85, 76, 66, 55, 43, 30, 16, 1;
  ...
		

Crossrefs

Cf. Diagonals: A000217, A034856, A055999,

Programs

  • Mathematica
    Table[s = {}; k = 0; While[tri = k*(k + 1)/2; tri <= n^2, AppendTo[s, n^2 - tri]; k++]; s, {n, 0, 10}] (* T. D. Noe, Mar 11 2013 *)

Formula

T(2*n,n) = A022264(n).
T(n,n) = n*(n-1)/2 = A000217(n-1).

A378301 a(n) is the number of triangular numbers (A000217) in the interval [n^2, (n + 1)^2].

Original entry on oeis.org

2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1
Offset: 0

Views

Author

Ctibor O. Zizka, Nov 22 2024

Keywords

Comments

After n=22, is the frequency of 1 always > 2? Are terms only 1 or 2? - Bill McEachen, Dec 10 2024
The distinct terms of this sequence are only 1 and 2. The asymptotic densities of the occurrences of 1 and 2 are 2-sqrt(2) = 0.585... and sqrt(2)-1 = 0.414..., respectively. The asymptotic mean of this sequence is sqrt(2). - Amiram Eldar, Dec 11 2024

Examples

			n = 0: in the interval [0, 1] are 2 triangular numbers {0, 1}, thus a(0) = 2.
n = 1: in the interval [1, 4] are 2 triangular numbers {1, 3}, thus a(1) = 2.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := Floor[(Sqrt[8*n+1]-1)/2]; a[n_] := s[(n + 1)^2] - s[n^2 - 1]; a[0] = 2; Array[a, 100, 0] (* Amiram Eldar, Dec 09 2024 *)
  • PARI
    a(n) = sum(k=n^2, (n+1)^2, ispolygonal(k,3)); \\ Michel Marcus, Dec 09 2024
    
  • Python
    from math import isqrt
    def A378301(n): return -(isqrt(m:=n**2<<3)+1>>1)+(isqrt(m+(n+1<<4))+1>>1) # Chai Wah Wu, Dec 09 2024

Formula

a(n) = 2 for n from A001110.
a(n) = A003056((n+1)^2) - A003056(n^2-1) for n >= 1. - Amiram Eldar, Dec 09 2024
a(n) = A002024((n+1)^2+1) - A002024(n^2). - Chai Wah Wu, Dec 09 2024

Extensions

a(53) corrected by Michel Marcus, Dec 09 2024
Showing 1-5 of 5 results.