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 43 results. Next

A209485 T(n,k) is the number of n-bead necklaces labeled with numbers -k..k allowing reversal, with sum zero and avoiding the patterns z z+1 z+2 and z z-1 z-2.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 1, 4, 4, 4, 1, 5, 7, 15, 4, 1, 6, 12, 35, 38, 11, 1, 7, 17, 72, 140, 136, 15, 1, 8, 24, 128, 390, 731, 458, 43, 1, 9, 31, 205, 866, 2606, 3740, 1781, 77, 1, 10, 40, 311, 1702, 7179, 17771, 20888, 6912, 199, 1, 11, 49, 448, 3014, 16660, 60778, 128598, 118137
Offset: 1

Views

Author

R. H. Hardin, Mar 09 2012

Keywords

Comments

Table starts
..1....1.....1......1......1.......1.......1........1........1........1.......1
..2....3.....4......5......6.......7.......8........9.......10.......11......12
..1....4.....7.....12.....17......24......31.......40.......49.......60......71
..4...15....35.....72....128.....205.....311......448......618......829....1083
..4...38...140....390....866....1702....3014.....4984.....7774....11620...16716
.11..136...731...2606...7179...16660...34233....64220...112263...185506..292759
.15..458..3740..17771..60778..168453..401634...857433..1679810..3074315.5321674
.43.1781.20888.128598.541494.1778878.4907310.11891268.26069478.52776268

Examples

			Some solutions for n=6, k=6:
.-5...-4...-5...-6...-6...-5...-6...-4...-3...-6...-6...-3...-5...-5...-6...-4
..0....0...-2...-3...-2...-4...-5...-3...-1....5....2...-2....0....2...-2....2
.-2...-2....2....4....0...-1....4....0...-1...-5....0...-2...-3...-4....6...-4
..2....2...-2....3....1....5....3....4....1....0...-4....5....2....1...-4....4
..5....0....5...-2....1....0....4....3...-2....0....6....0....5....0....0...-4
..0....4....2....4....6....5....0....0....6....6....2....2....1....6....6....6
		

Crossrefs

Row 3 is A074148.
Row 4 is A209345.

Formula

Empirical for row n:
n=2: a(k) = 2*a(k-1) - a(k-2).
n=3: a(k) = 2*a(k-1) - 2*a(k-3) + a(k-4).
n=4: a(k) = 3*a(k-1) - 3*a(k-2) + 2*a(k-3) - 3*a(k-4) + 3*a(k-5) - a(k-6).
n=5: a(k) = 2*a(k-1) - a(k-3) - 2*a(k-5) + 2*a(k-6) + a(k-8) - 2*a(k-10) + a(k-11).
n=6: a(k) = 5*a(k-1) - 10*a(k-2) + 11*a(k-3) - 10*a(k-4) + 11*a(k-5) - 10*a(k-6) + 5*a(k-7) - a(k-8) for k > 9.

A229154 The clubs patterns appearing in n X n coins, with rotation allowed.

Original entry on oeis.org

1, 2, 5, 8, 12, 16, 21, 27, 33, 40, 48, 56, 65, 75, 85, 96, 108, 120, 133, 147, 161, 176, 192, 208, 225, 243, 261, 280, 300, 320, 341, 363, 385, 408, 432, 456, 481, 507, 533, 560, 588, 616, 645, 675, 705, 736, 768, 800, 833, 867, 901, 936, 972, 1008, 1045
Offset: 2

Views

Author

Kival Ngaokrajang, Sep 15 2013

Keywords

Comments

On the Japanese TV show "Tsuki no Koibito", a girl told her boyfriend that she saw a heart in 4 coins. Actually there are a total of 6 distinct patterns appearing in 2 X 2 coins in which each pattern consists of a part of the perimeter of each coin and forms a continuous area.
a(n) is the number of clubs patterns appearing in n X n coins with rotation allowed. It is also A000212, except for the fourth term. The number of inverse patterns (stars or voids between clubs) is A143978 (except for the first term).

Crossrefs

Cf. A000212, A143978, A074148 (Heart patterns), A227906, A229093 (Clubs pattern, fixed Orientation).

Programs

  • Mathematica
    CoefficientList[Series[-(x^6 - 2 x^5 + x^4 - x^3 + 2 x^2 + 1)/((x - 1)^3 (x^2 + x + 1)), {x, 0, 60}], x] (* Vincenzo Librandi, Oct 08 2013 *)
  • PARI
    Vec(-x^2*(x^6-2*x^5+x^4-x^3+2*x^2+1)/((x-1)^3*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Oct 08 2013

Formula

a(n) = floor(n^2/3), a(3) = 2.
From Colin Barker, Oct 08 2013: (Start)
a(n) = n^2/3 + (2/9)*cos((2*Pi*n)/3) - 2/9.
G.f.: -x^2*(x^6-2*x^5+x^4-x^3+2*x^2+1) / ((x-1)^3*(x^2+x+1)). (End)

Extensions

More terms from Colin Barker, Oct 08 2013

A229593 Number of boomerang patterns appearing in n X n coins, rotation not allowed.

Original entry on oeis.org

0, 2, 3, 4, 10, 12, 14, 24, 27, 30, 44, 48, 52, 70, 75, 80, 102, 108, 114, 140, 147, 154, 184, 192, 200, 234, 243, 252, 290, 300, 310, 352, 363, 374, 420, 432, 444, 494, 507, 520, 574, 588, 602, 660, 675, 690, 752, 768
Offset: 2

Views

Author

Kival Ngaokrajang, Sep 26 2013

Keywords

Comments

The boomerang pattern is one of a total of 17 distinct patterns appearing in a 3 X 2 rectangular array of coins where each pattern consists of perimeter parts from each of 6 coins and forms a continuous area. See illustration of 6-curve patterns in links.
a(n) is the number of boomerang patterns appearing in an n X n array of coins with rotation not allowed. The number of inverse patterns is given in A229598.
It appears that a(n+1) is equivalent to n multiplied by the least possible number of addends in the partition in which the addends are multiplied together to produce the largest possible product for all n > 2. E.g., in the case of a(11), we look for partitions of 10, and for each partition we take the product of all its addends. The largest possible product formed is 3*3*2*2 = 3*3*4 = 36. The least possible number of addends here is 3, which we multiply by 10 to get 30. - Laurance L. Y. Lau, Jun 22 2015

Crossrefs

Cf. A074148 (Heart patterns), A229093 (Clubs patterns - fixed orientation), A229154 (Clubs Patterns - rotation allowed)

Programs

  • Magma
    [(n-1)*Floor(n/3): n in [2..60]]; // Vincenzo Librandi, Jul 09 2015
  • Mathematica
    CoefficientList[Series[(2 x^4 + x^3 + x^2 + 2 x)/((1 - x^3)^2 (1 - x)), {x, 0, 80}], x] (* Vincenzo Librandi, Oct 10 2013 *)
  • PARI
    a(n)=([0,1,0,0,0,0,0; 0,0,1,0,0,0,0; 0,0,0,1,0,0,0; 0,0,0,0,1,0,0; 0,0,0,0,0,1,0; 0,0,0,0,0,0,1; 1,-1,0,-2,2,0,1]^(n-2)*[0;2;3;4;10;12;14])[1,1] \\ Charles R Greathouse IV, Jun 16 2015
    

Formula

G.f.: (2*x^6 + x^5 + x^4 + 2*x^3)/((1-x^3)^2 * (1-x)). - Ralf Stephan, Oct 05 2013
3*a(n) = (1-n)^2 -2*A057078(n) +(-1)^n*A110665(n+1). - R. J. Mathar, Oct 09 2013
a(n) = (n-1)*floor(n/3). - Laurance L. Y. Lau, Jun 22 2015

Extensions

G.f. adapted to the offset by Vincenzo Librandi, Oct 10 2013

A238012 Number A(n,k) of partitions of k^n into parts that are at most n with at least one part of each size; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 4, 2, 0, 0, 0, 1, 7, 48, 9, 0, 0, 0, 1, 12, 310, 3042, 119, 0, 0, 0, 1, 17, 1240, 109809, 1067474, 4935, 0, 0, 0, 1, 24, 3781, 1655004, 370702459, 2215932130, 596763, 0, 0, 0, 1, 31, 9633, 14942231, 32796849930, 13173778523786, 29012104252380, 211517867, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Feb 16 2014

Keywords

Comments

In general, column k>=2 is asymptotic to k^(n*(n-1)) / (n!*(n-1)!). - Vaclav Kotesovec, Jun 05 2015

Examples

			Square array A(n,k) begins:
  0, 0,   0,       0,         0,           0, ...
  0, 1,   1,       1,         1,           1, ...
  0, 0,   1,       4,         7,          12, ...
  0, 0,   2,      48,       310,        1240, ...
  0, 0,   9,    3042,    109809,     1655004, ...
  0, 0, 119, 1067474, 370702459, 32796849930, ...
		

Crossrefs

Rows n=0-2 give: A000004, A057427, A074148(k-1) for k>1.
Main diagonal gives A238001.
Cf. A238010.

Programs

  • Mathematica
    A[0, 0] = 0;
    A[n_, k_] := SeriesCoefficient[Product[1/(1-x^j), {j, 1, n}], {x, 0, k^n - n(n+1)/2}];
    Table[A[n-k, k], {n, 0, 10}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Aug 18 2018, after Alois P. Heinz *)

Formula

A(n,k) = [x^(k^n-n*(n+1)/2)] Product_{j=1..n} 1/(1-x^j).

A143182 Triangle T(n,m) = 1 + abs(n-2*m), read by rows, 0<=m<=n.

Original entry on oeis.org

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

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 17 2008

Keywords

Comments

From Boris Putievskiy, Jan 15 2013: (Start)
General case see A187760. Let m be natural number. Table T(n,k) n, k > 0, T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+m-1, if n < k. Table T(n,k) read by antidiagonals. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A220073, for m=2 the result is A143182. (End)

Examples

			From _Boris Putievskiy_, Jan 15 2013: (Start)
The start of the sequence as table:
1...2...3...4...5...6...7...8...9..10..11...
2...1...2...3...4...5...6...7...8...9..10...
3...2...1...2...3...4...5...6...7...8...9...
4...3...2...1...2...3...4...5...6...7...8...
5...4...3...2...1...2...3...4...5...6...7...
6...5...4...3...2...1...2...3...4...5...6...
7...6...5...4...3...2...1...2...3...4...5...
8...7...6...5...4...3...2...1...2...3...4...
9...8...7...6...5...4...3...2...1...2...3...
10..9...8...7...6...5...4...3...2...1...2...
11.10...9...8...7...6...5...4...3...2...1...
. . .
The start of the sequence as triangle array read by rows: (End)
   1;
   2, 2;
   3, 1, 3;
   4, 2, 2, 4;
   5, 3, 1, 3, 5;
   6, 4, 2, 2, 4, 6;
   7, 5, 3, 1, 3, 5, 7;
   8, 6, 4, 2, 2, 4, 6, 8;
   9, 7, 5, 3, 1, 3, 5, 7, 9;
  10, 8, 6, 4, 2, 2, 4, 6, 8, 10;
  11, 9, 7, 5, 3, 1, 3, 5, 7,  9, 11;
. . .
Row number r contains r numbers: r, r-2,...3,1,3,...r-2,r if r is odd,
r, r-2,...2,2,...r-2,r, if r is even. - _Boris Putievskiy_, Jan 15 2013
		

Crossrefs

Cf. A049581 (subtract 1's), A074148 (row sums), A000027, A220073, A187760.

Programs

  • GAP
    Flat(List([0..15], n-> List([0..n], k-> 1+AbsInt(n-2*k) ))); # G. C. Greubel, Jul 23 2019
  • Magma
    [1+Abs(n-2*k): k in [0..n], n in [0..15]]; // G. C. Greubel, Jul 23 2019
    
  • Mathematica
    T[n_, m_]:= 1+Abs[(1+n-m) - (1+m)]; Table[Table[t[n, m], {m,0,n}], {n, 0, 15}]//Flatten
  • PARI
    for(n=0,15, for(k=0,n, print1(1+abs(n-2*k), ", "))) \\ G. C. Greubel, Jul 23 2019
    
  • Sage
    [[1+abs(n-2*k) for k in (0..n)] for n in (0..15)] # G. C. Greubel, Jul 23 2019
    

Formula

Symmetry: T(n,m) = T(n,n-m).
From Boris Putievskiy, Jan 15 2013: (Start)
For the general case
a(n) = |(t+1)^2 - 2n| + m*floor((t^2+3t+2-2n)/(t+1)),
where t = floor((-1+sqrt(8*n-7))/2).
For m = 2
a(n) = |(t+1)^2 - 2n| + 2*floor((t^2+3t+2-2n)/(t+1)),
where t=floor((-1+sqrt(8*n-7))/2). (End)

Extensions

Offset and row sums corrected by R. J. Mathar, Jul 05 2012

A230267 Coins left after packing 5 curves coins patterns into fountain of coins base n.

Original entry on oeis.org

1, 3, 2, 6, 7, 9, 12, 16, 17, 23, 26, 30, 35, 41, 44, 52, 57, 63, 70, 78, 83, 93, 100, 108, 117, 127, 134, 146, 155, 165, 176, 188, 197, 211, 222, 234, 247, 261, 272, 288, 301, 315, 330, 346, 359, 377, 392, 408, 425, 443
Offset: 1

Views

Author

Kival Ngaokrajang, Oct 15 2013

Keywords

Comments

Refer to arrangement same as A005169: "A fountain is formed by starting with a row of coins, then stacking additional coins on top so that each new coin touches two in the previous row". The 5 curves coins patterns consist of a part of circumference and forms continuous area. There is total 13 distinct patterns. I would like to call "5C4S" type as it cover 4 coins and symmetry. When packing 5C4S into fountain of coins base n, the total number of 5C4S is A001399, the coins left is a(n) and void is A230276. See illustration in links.

Crossrefs

Cf. A008795 (3-curves coins patterns), A074148, A229093, A229154 (4-curves coins patterns), A001399 (5-curves coins patterns), A229593 (6-curves coins patterns).

Formula

G.f.: x*(x^3 - 2*x^2 + 2*x + 1)/((1-x)*(1-x^2)*(1-x^3)) (conjectured). - Ralf Stephan, Oct 17 2013

A230276 Voids left after packing 5-curves coins patterns into fountain of coins with base n.

Original entry on oeis.org

0, 1, 1, 6, 10, 16, 24, 34, 43, 57, 70, 85, 102, 121, 139, 162, 184, 208, 234, 262, 289, 321, 352, 385, 420, 457, 493, 534, 574, 616, 660, 706, 751, 801, 850, 901, 954, 1009, 1063, 1122, 1180, 1240, 1302, 1366, 1429
Offset: 1

Views

Author

Kival Ngaokrajang, Oct 15 2013

Keywords

Comments

Refer to arrangement same as A005169: "A fountain is formed by starting with a row of coins, then stacking additional coins on top so that each new coin touches two in the previous row". The 5 curves coins patterns consist of a part of each coin circumference and forms a continuous area. There are total 13 distinct patterns. For selected pattern, I would like to call "5C4S" type as it cover 4 coins and symmetry. When packing 5C4S into fountain of coins base n, the total number of 5C4S is A001399, the coins left is A230267 and void left is a(n). See illustration in links.

Crossrefs

Cf. A008795 (3-curves coins patterns), A074148, A229093, A229154 (4-curves coins patterns), A001399 (5-curves coins patterns), A229593 (6-curves coins patterns).

Programs

  • Maple
    A099837 := proc(n)
        op(modp(n,3)+1,[2,-1,-1]) ;
    end proc:
    A230276 := proc(n)
        -A099837(n)/3 + (-48*n+31+18*n^2+9*(-1)^n)/24 ;
    end proc:
    seq(A230276(n),n=1..40) ; # R. J. Mathar, Feb 28 2018
  • Mathematica
    LinearRecurrence[{1, 1, 0, -1, -1, 1}, {0, 1, 1, 6, 10, 16}, 45] (* Jean-François Alcover, May 05 2023 *)

Formula

G.f.: x^2*(x^4 + 3*x^3 + 4*x^2 + 1)/((1-x)*(1-x^2)*(1-x^3)). - Ralf Stephan, Oct 17 2013
a(n) = (9*(-1)^n+18*n^2-48*n)/24 - A099837(n)/3. - R. J. Mathar, Feb 28 2018

A227906 Coins left after packing heart patterns (fixed orientation) into n X n coins.

Original entry on oeis.org

2, 4, 4, 9, 6, 13, 8, 17, 10, 21, 12, 25, 14, 29, 16, 33, 18, 37, 20, 41, 22, 45, 24, 49, 26, 53, 28, 57, 30, 61, 32, 65, 34, 69, 36, 73, 38, 77, 40, 81, 42, 85, 44, 89, 46, 93, 48, 97, 50, 101, 52, 105, 54, 109, 56, 113, 58, 117, 60, 121
Offset: 2

Views

Author

Kival Ngaokrajang, Oct 19 2013

Keywords

Comments

On the Japanese TV show "Tsuki no Koibito", a girl told her boyfriend that she saw a heart in 4 coins. Actually there are a total of 6 distinct patterns appearing in 2 X 2 coins in which each pattern consists of a part of the perimeter of each coin and forms a continuous area.
a(n) is the number of coins left after packing fixed orientation heart patterns (type 4c2s1: 4-curve cover 2 coins and symmetry) into n X n coins. The total number of hearts is A093005 and the number of voids left is A093353. See illustration in links.

Crossrefs

Cf. A008795, A230370 (3-curves), A074148, A229093, A229154 (4-curves), A001399, A230267, A230276 (5-curves), A229593, A228949, A229598 (6-curves).

Programs

  • Mathematica
    With[{nn=60},Join[{2,4},Riffle[Range[4,nn,2],Range[9,2nn+1,4]]]] (* Harvey P. Dale, Feb 11 2015 *)
  • PARI
    Vec(-x^2*(x^5-x^3-4*x-2)/((x-1)^2*(x+1)^2) + O(x^100)) \\ Colin Barker, Oct 30 2013

Formula

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

A074149 Sum of terms in each group in A074147.

Original entry on oeis.org

1, 6, 15, 36, 65, 114, 175, 264, 369, 510, 671, 876, 1105, 1386, 1695, 2064, 2465, 2934, 3439, 4020, 4641, 5346, 6095, 6936, 7825, 8814, 9855, 11004, 12209, 13530, 14911, 16416, 17985, 19686, 21455, 23364, 25345, 27474, 29679, 32040, 34481, 37086
Offset: 1

Views

Author

Amarnath Murthy, Aug 28 2002

Keywords

Comments

The odd-indexed entries are the sums pertaining to the corresponding magic squares.

Crossrefs

Programs

Formula

a(2n-1) = 4n^3 - 6n^2 + 4n - 1, a(2n) = 4n^3 + 2n. a(n) = (n^3 + n)/2 if n odd, n^3/2 + n if n even. a(n) = n^3/2 + n(3 + (-1)^n)/4. - Franklin T. Adams-Watters, Jul 17 2006
G.f.: x*(x^2+1)*(x^2+4*x+1) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Mar 07 2011
E.g.f.: x*((2 + 3*x + x^2)*cosh(x) + (3 + 3*x + x^2)*sinh(x))/2. - Stefano Spezia, May 07 2021
a(n) = n*(n^2-A000035(n))/2 + n. - Chai Wah Wu, Aug 30 2022

Extensions

More terms from Franklin T. Adams-Watters, Jul 17 2006

A123663 Number of shared edges in a spiral of n unit squares.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 8, 10, 12, 13, 15, 17, 18, 20, 22, 24, 25, 27, 29, 31, 32, 34, 36, 38, 40, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 60, 61, 63, 65, 67, 69, 71, 72, 74, 76, 78, 80, 82, 84, 85, 87, 89, 91, 93, 95, 97, 98, 100, 102, 104, 106, 108, 110, 112, 113, 115, 117, 119
Offset: 1

Views

Author

Zacariaz Martinez, Nov 15 2006

Keywords

Comments

If one constructs a square (square 1) and then draws another square of identical size beside it (square 2), the squares share 1 edge. If one then places an identical square above square 2 (instead of continuing in a straight path), there are now 2 shared edges. Continuing this pattern in an outward spiral, one finds that the number of shared edges is 4, 5, 7, ...
Numbers a(n) such that a(n+1) = a(n) + 1 are (except for the leading zero) A074148. Otherwise a(n+1) = a(n) + 2. - Franklin T. Adams-Watters, Oct 17 2014.
This sequence is also the maximal number of shared edges among all polyominoes with n square cells. This is the result of Harary and Harborth cited in the references. Once this is known the formula 2n - ceiling(2*sqrt(n)) comes from geometrical considerations and A027709. Namely, the 4n sides of the n squares making up the polyomino form the perimeter and come together in pairs along shared edges. Hence, 4n = perimeter + 2*shared edges. Maximizing shared edges minimizes perimeter and so maximum shared edges = (4n - minimum perimeter)/2 = (4n - 2ceiling(2*sqrt(n)))/2 = 2n - ceiling(2*sqrt(n)). This interpretation is important to landscape ecologists and is called the aggregation index in the GIS program FRAGSTATS. - Julian F. Fleron, Nov 29 2016
a(n) is also the maximum degree of the cover graphs of lattice quotients of lattice congruences of the weak order on the symmetric group S_n. See Table 1 in the Hoang/Mütze reference in the Links section. - Torsten Muetze, Nov 28 2019
a(n) is also the number of pixels in H_{n-1}, where H_n (a pixelated piece of hyperbola x*y = n) is the set of the (x, y), ordered pairs of positive integers, such that x*y = n or (x*y < n and ((x+1)*y > n or x*(y+1) > n)). - Luc Rousseau, Dec 28 2019

References

  • F. Harary and H. Harborth, Extremal Animals, Journal of Combinatorics, Information & System Sciences, Vol. 1, No 1, 1-8 (1976).

Crossrefs

Cf. A002620.

Programs

  • Maple
    A[1]:= 0:
    for n from 2 to 100 do
      if issqr(2*A[n-1]+1) or issqr(2*A[n-1]+2) then A[n]:= A[n-1]+1
      else A[n]:= A[n-1]+2
      fi
    od:
    seq(A[n],n=1..100); # Robert Israel, Oct 21 2014
  • Mathematica
    FoldList[Plus, 0, t = Table[2, {72}]; t[[ Table[ Ceiling[n/2] Floor[n/2], {n, 2, 16}] ]]--; t] (* Robert G. Wilson v, Jan 19 2007 *)
  • PARI
    a(n)=2*n - sqrtint(4*n-1) - 1 \\ Charles R Greathouse IV, Nov 29 2016
    
  • Python
    from math import isqrt
    def A123663(n): return (m:=n<<1)-1-isqrt((m<<1)-1) # Chai Wah Wu, Jul 28 2022
  • Ruby
    a123663 = [0]; k = 0; a_n = 0; (1..N).to_a.each{ |i| 2.times{ k.times{ a_n += 2; a123663 << a_n }; a_n += 1; a123663 << a_n; }; k += 1}
    

Formula

a(n) = 2n - ceiling(2*sqrt(n)). - Julian F. Fleron, Nov 29 2016
a(n) = a(n-1) + 2 - [n-1 is a square or a pronic number], where [] stands for the Iverson bracket. - Luc Rousseau, Dec 28 2019

Extensions

Extended by Robert G. Wilson v, Jan 19 2007
Previous Showing 11-20 of 43 results. Next