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

A001614 Connell sequence: 1 odd, 2 even, 3 odd, ...

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17, 19, 21, 23, 25, 26, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 60, 62, 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 122
Offset: 1

Views

Author

Keywords

Comments

Next (2n-1) odd numbers alternating with next 2n even numbers. Squares (A000290(n)) occur at the A000217(n)-th entry. - Lekraj Beedassy, Aug 06 2004. - Comment corrected by Daniel Forgues, Jul 18 2009
a(t_n) = a(n(n+1)/2) = n^2 relates squares to triangular numbers. - Daniel Forgues
The natural numbers not included are A118011(n) = 4n - a(n) as n=1,2,3,... - Paul D. Hanna, Apr 10 2006
As a triangle with row sums = A069778 (1, 6, 21, 52, 105, ...): /Q 1;/Q 2, 4;/Q 5, 7, 9;/Q 10, 12, 14, 16;/Q ... . - Gary W. Adamson, Sep 01 2008
The triangle sums, see A180662 for their definitions, link the Connell sequence A001614 as a triangle with six sequences, see the crossrefs. - Johannes W. Meijer, May 20 2011
a(n) = A122797(n) + n - 1. - Reinhard Zumkeller, Feb 12 2012

Examples

			From _Omar E. Pol_, Aug 13 2013: (Start)
Written as a triangle the sequence begins:
   1;
   2,  4;
   5,  7,  9;
  10, 12, 14, 16;
  17, 19, 21, 23, 25;
  26, 28, 30, 32, 34, 36;
  37, 39, 41, 43, 45, 47, 49;
  50, 52, 54, 56, 58, 60, 62, 64;
  65, 67, 69, 71, 73, 75, 77, 79, 81;
  82, 84, 86, 88, 90, 92, 94, 96, 98, 100;
  ...
Right border gives A000290, n >= 1.
(End)
		

References

  • C. Pickover, Computers and the Imagination, St. Martin's Press, NY, 1991, p. 276.
  • C. A. Pickover, The Mathematics of Oz, Chapter 39, Camb. Univ. Press UK 2002.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A117384, A118011 (complement), A118012.
Cf. A069778. - Gary W. Adamson, Sep 01 2008
From Johannes W. Meijer, May 20 2011: (Start)
Triangle columns: A002522, A117950 (n>=1), A117951 (n>=2), A117619 (n>=3), A154533 (n>=5), A000290 (n>=1), A008865 (n>=2), A028347 (n>=3), A028878 (n>=1), A028884 (n>=2), A054569 [T(2*n,n)].
Triangle sums (see the comments): A069778 (Row1), A190716 (Row2), A058187 (Related to Kn11, Kn12, Kn13, Kn21, Kn22, Kn23, Fi1, Fi2, Ze1 and Ze2), A000292 (Related to Kn3, Kn4, Ca3, Ca4, Gi3 and Gi4), A190717 (Related to Ca1, Ca2, Ze3, Ze4), A190718 (Related to Gi1 and Gi2). (End)

Programs

  • Haskell
    a001614 n = a001614_list !! (n-1)
    a001614_list = f 0 0 a057211_list where
       f c z (x:xs) = z' : f x z' xs where z' = z + 1 + 0 ^ abs (x - c)
    -- Reinhard Zumkeller, Dec 30 2011
    
  • Magma
    [2*n-Round(Sqrt(2*n)): n in [1..80]]; // Vincenzo Librandi, Apr 17 2015
    
  • Maple
    A001614:=proc(n): 2*n - floor((1+sqrt(8*n-7))/2) end: seq(A001614(n),n=1..67); # Johannes W. Meijer, May 20 2011
  • Mathematica
    lst={};i=0;For[j=1, j<=4!, a=i+1;b=j;k=0;For[i=a, i<=9!, k++;AppendTo[lst, i];If[k>=b, Break[]];i=i+2];j++ ];lst (* Vladimir Joseph Stephan Orlovsky, Aug 29 2008 *)
    row[n_] := 2*Range[n+1]+n^2-1; Table[row[n], {n, 0, 11}] // Flatten (* Jean-François Alcover, Oct 25 2013 *)
  • PARI
    a(n)=2*n - round(sqrt(2*n)) \\ Charles R Greathouse IV, Apr 20 2015
    
  • Python
    from math import isqrt
    def A001614(n): return (m:=n<<1)-(k:=isqrt(m))-int((m<<2)>(k<<2)*(k+1)+1) # Chai Wah Wu, Jul 26 2022

Formula

a(n) = 2*n - floor( (1+ sqrt(8*n-7))/2 ).
a(n) = A005843(n) - A002024(n). - Lekraj Beedassy, Aug 06 2004
a(n) = A118012(A118011(n)). A117384( a(n) ) = n; A117384( 4*n - a(n) ) = n. - Paul D. Hanna, Apr 10 2006
a(1) = 1; then a(n) = a(n-1)+1 if a(n-1) is a square, a(n) = a(n-1)+2 otherwise. For example, a(21)=36 is a square therefore a(22)=36+1=37 which is not a square so a(23)=37+2=39 ... - Benoit Cloitre, Feb 07 2007
T(n,k) = (n-1)^2 + 2*k - 1. - Omar E. Pol, Aug 13 2013
a(n)^2 = a(n*(n+1)/2). - Ivan N. Ianakiev, Aug 15 2013
Let the sequence be written in the form of the triangle in the EXAMPLE section below and let a(n) and a(n+1) belong to the same row of the triangle. Then a(n)*a(n+1) + 1 = a(A000217(A118011(n))) = A000290(A118011(n)). - Ivan N. Ianakiev, Aug 16 2013
a(n) = 2*n-round(sqrt(2*n)). - Gerald Hillier, Apr 15 2015
From Robert Israel, Apr 20 2015 (Start):
G.f.: 2*x/(1-x)^2 - (x/(1-x))*Sum_{n>=0} x^(n*(n+1)/2) = 2*x/(1-x)^2 - (Theta2(0,x^(1/2)))*x^(7/8)/(2*(1-x)) where Theta2 is a Jacobi theta function.
a(n) = 2*n-1 - Sum_{i=0..n-2} A023531(i). (End)
a(n) = 3*n-A014132(n). - Chai Wah Wu, Oct 19 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 16 2001

A073773 Number of plane binary trees of size n+2 and height n.

Original entry on oeis.org

0, 0, 0, 6, 40, 152, 480, 1376, 3712, 9600, 24064, 58880, 141312, 333824, 778240, 1794048, 4096000, 9273344, 20840448, 46530560, 103284736, 228065280, 501219328, 1096810496, 2390753280, 5192548352, 11240734720, 24259854336
Offset: 0

Views

Author

Antti Karttunen, Aug 11 2002

Keywords

Examples

			a(3) = 6 because there exists only these six binary trees of size 5 and height 3:
_\/\/_______\/\/_\/_\/_____\/_\/_\/___\/___V_V___
__\/_\/___\/_\/___\/_\/___\/_\/___\/_\/___\/_\/__
___\./_____\./_____\./_____\./_____\./_____\./___
		

Crossrefs

Programs

  • Maple
    A073773 := n -> `if`((n < 3),0,((n^2 - 6)*2^(n-2)));

Formula

a(n) = A073345(n+2, n).
a(n < 3) = 0, a(n) = ((n^2 - 6)*2^(n-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).

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).

A153169 a(n) = 4*n^2 + 12*n + 3.

Original entry on oeis.org

19, 43, 75, 115, 163, 219, 283, 355, 435, 523, 619, 723, 835, 955, 1083, 1219, 1363, 1515, 1675, 1843, 2019, 2203, 2395, 2595, 2803, 3019, 3243, 3475, 3715, 3963, 4219, 4483, 4755, 5035, 5323, 5619, 5923, 6235, 6555, 6883, 7219, 7563, 7915, 8275, 8643, 9019, 9403
Offset: 1

Views

Author

Vincenzo Librandi, Dec 20 2008

Keywords

Comments

Sequence gives values of x such that x^3 + 6*x^2 = y^2 since a(n)^3 + 6*a(n)^2 = (8*n^3 + 36*n^2 + 42*n + 9)^2.
The complete list of nonnegative values of x in x^3 + 6*x^2 = y^2 is given by A028878. - Bruno Berselli, Jan 25 2012

Crossrefs

Programs

  • Magma
    I:=[19, 43, 75]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..50]]; // Vincenzo Librandi, Feb 25 2012
    
  • Mathematica
    LinearRecurrence[{3, -3, 1}, {19, 43, 75}, 50] (* Vincenzo Librandi, Feb 25 2012 *)
  • PARI
    for(n=1, 50, print1(4*n^2 + 12*n + 3", ")); \\ Vincenzo Librandi, Feb 25 2012

Formula

From Colin Barker, Jan 24 2012: (Start)
G.f.: x*(19 - 14*x + 3*x^2)/(1-x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3); a(1)=19, a(2)=43, a(3)=75. (End)
Sum_{n>=1} 1/a(n) = -2/15 + tan(sqrt(3/2)*Pi)*Pi/(4*sqrt(6)). - Amiram Eldar, Mar 02 2023
From Elmo R. Oliveira, Jun 03 2025: (Start)
E.g.f.: -3 + (3 + 16*x + 4*x^2)*exp(x).
a(n) = A028878(2*n) for n >= 1. (End)

Extensions

Definition rewritten by Bruno Berselli, Jan 25 2012

A214870 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 counterclockwise. T(n,k) read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Mar 11 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) 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(n,2), T(n,4), ... T(4,n), T(2,n);
. . .

Examples

			The start of the sequence as table:
   1   2   5  10  17  26 ...
   3   4   9  16  25  36 ...
   7   8   6  11  18  27 ...
  13  14  12  15  24  35 ...
  21  22  20  23  19  28 ...
  31  32  30  33  29  34 ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   5,  4,  7;
  10,  9,  8, 13;
  17, 16,  6, 14, 21;
  26, 25, 11, 12, 22, 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-i+(j%2)*(2-(j+1)/2)+((j+1)%2)*(j/2+1)
    else:
       result=j*j-2*(i%2)*j + (i%2)*((i+1)/2+1) + ((i+1)%2)*(-i/2+1)

Formula

As table
T(n,k) = k*k-2*(n mod 2)*k+(n mod 2)*((n+1)/2+1)+((n+1) mod 2)*(-n/2+1), if n<=k;
T(n,k) = n*n-n+(k mod 2)*(2-(k+1)/2)+((k+1) mod 2)*(k/2+1), if n>k.
As linear sequence
a(n) = j*j-2*(i mod 2)*j+(i mod 2)*((i+1)/2+1)+((i+1) mod 2)*(-i/2+1), if i<=j;
a(n) = i*i-i+(j mod 2)*(2-(j+1)/2)+((j+1) mod 2)*(j/2+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).

A361045 Array read by descending antidiagonals. A(n, k) is, if n > 0, the number of multiset combinations of {0, 1} whose type is defined in the comments. A(0, k) = k + 1.

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 10, 6, 1, 5, 20, 19, 8, 1, 6, 35, 44, 30, 10, 1, 7, 56, 85, 76, 43, 12, 1, 8, 84, 146, 155, 116, 58, 14, 1, 9, 120, 231, 276, 245, 164, 75, 16, 1, 10, 165, 344, 448, 446, 355, 220, 94, 18, 1, 11, 220, 489, 680, 735, 656, 485, 284, 115, 20, 1
Offset: 0

Views

Author

Peter Luschny, Mar 21 2023

Keywords

Comments

A combination of a multiset M is an unordered selection of k objects of M, where every object can appear at most as many times as it appears in M.
A(n, k) = Sum_{j=0..k} Cardinality(Combination(MultiSet(1^[j*n], 0^[(k-j)*n]))), where MultiSet(r^[s], u^[v]) denotes a set that contains the element r with multiplicity s and the element u with multiplicity v; thus the multisets under consideration have n*k elements. Since the base set is {1, 0} the elements can be represented as binary strings. Applying the combination operator to the multisets results in a set of binary strings where '0' resp. '1' can appear at most j*n resp. (k-j)*n times. 'At most' means that they do not have to appear; in other words, the resulting set always includes the empty string ''.
This construction is the counterpart of A361043, generated by substituting 'Permutations' with 'Combinations' in the formulas (resp. programs). But since the resulting sets are not disjoint, this leads to multiple counting of some elements. If this is not desired, one can choose the variant described in A361682.

Examples

			Array A(n, k) starts:
[0] 1,  2,  3,   4,   5,   6,    7,    8,    9,   10, ...  A000027
[1] 1,  4, 10,  20,  35,  56,   84,  120,  165,  220, ...  A000292
[2] 1,  6, 19,  44,  85, 146,  231,  344,  489,  670, ...  A005900
[3] 1,  8, 30,  76, 155, 276,  448,  680,  981, 1360, ...  A100175
[4] 1, 10, 43, 116, 245, 446,  735, 1128, 1641, 2290, ...  A336288
[5] 1, 12, 58, 164, 355, 656, 1092, 1688, 2469, 3460, ...
[6] 1, 14, 75, 220, 485, 906, 1519, 2360, 3465, 4870, ...
.
Triangle T(n, k) starts:
[0]  1;
[1]  2,   1;
[2]  3,   4,   1;
[3]  4,  10,   6,   1;
[4]  5,  20,  19,   8,   1;
[5]  6,  35,  44,  30,  10,   1;
[6]  7,  56,  85,  76,  43,  12,   1;
[7]  8,  84, 146, 155, 116,  58,  14,  1;
[8]  9, 120, 231, 276, 245, 164,  75, 16,  1;
[9] 10, 165, 344, 448, 446, 355, 220, 94, 18, 1;
.
A(2, 3) = card('', 0, 00, 000, 0000) + card('', 1, 0, 11, 10, 00, 110, 100, 1100) + card('', 1, 11, 111, 1111) = 5 + 9 + 5 = 19.
		

Crossrefs

Columns: A000012, A005843, A028878.
Cf. A361682 (combinations with unique elements), A361043 (multiset permutations).

Programs

  • SageMath
    def A(n: int, k: int) -> int:
        if n == 0: return k + 1
        count = 0
        for a in range(0, n * k + 1, n):
            S = [i < a for i in range(n * k)]
            count += Combinations(S).cardinality()
        return count
    def ARow(n: int, size: int) -> list[int]:
        return [A(n, k) for k in range(size)]
    for n in range(7): print([n], ARow(n, 6))
Showing 1-7 of 7 results.