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

A069905 Number of partitions of n into 3 positive parts.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 19, 21, 24, 27, 30, 33, 37, 40, 44, 48, 52, 56, 61, 65, 70, 75, 80, 85, 91, 96, 102, 108, 114, 120, 127, 133, 140, 147, 154, 161, 169, 176, 184, 192, 200, 208, 217, 225, 234, 243, 252, 261, 271, 280, 290, 300, 310, 320, 331, 341
Offset: 0

Views

Author

N. J. A. Sloane, May 04 2002

Keywords

Comments

Number of binary bracelets of n beads, 3 of them 0. For n >= 3, a(n-3) is the number of binary bracelets of n beads, 3 of them 0, with 00 prohibited. - Washington Bomfim, Aug 27 2008
Also number of partitions of n-3 into parts 1, 2, and 3. - Joerg Arndt, Sep 05 2013
Number of incongruent triangles with integer sides that have perimeter 2n-3 (see the Jordan et al. link). - Freddy Barrera, Aug 18 2018
Number of ordered triples (x,y,z) of nonnegative integers such that x+y+z=n and xDennis P. Walsh, Apr 19 2019
Number of incongruent triangles formed from any 3 vertices of a regular n-gon. - Frank M Jackson, Sep 11 2022
Also a(n-3) for n > 2, otherwise 0 is the number of incongruent scalene triangles formed from the vertices of a regular n-gon. - Frank M Jackson, Nov 27 2022

Examples

			G.f. = x^3 + x^4 + 2*x^5 + 3*x^6 + 4*x^7 + 5*x^8 + 7*x^9 + 8*x^10 + 10*x^11 + ...
		

References

  • Ross Honsberger, Mathematical Gems III, Math. Assoc. Amer., 1985, p. 39.
  • Donald E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.4, p. 410.
  • Donald E. Knuth, The Art of Computer Programming, vol. 4,fascicle 3, Generating All Combinations and Partitions, Section 7.2.1.4., p. 56, exercise 31.

Crossrefs

Another version of A001399, which is the main entry for this sequence.
Cf. A005044, A008284, A008615, A026810 (4 positive parts).

Programs

  • GAP
    List([0..70],n->NrPartitions(n,3)); # Muniru A Asiru, May 17 2018
    
  • Haskell
    a069905 n = a069905_list !! n
    a069905_list = scanl (+) 0 a008615_list
    -- Reinhard Zumkeller, Apr 28 2014
    
  • Magma
    [(n^2+6) div 12: n in [0..70]]; // Vincenzo Librandi, Oct 14 2015
    
  • Maple
    A069905 := n->round(n^2/12): seq(A069905(n), n=0..70);
  • Mathematica
    a[ n_]:= Round[ n^2 / 12] (* Michael Somos, Sep 04 2013 *)
    CoefficientList[Series[x^3/((1-x)(1-x^2)(1-x^3)), {x, 0, 70}], x] (* Vincenzo Librandi, Oct 14 2015 *)
    Drop[LinearRecurrence[{1,1,0,-1,-1,1}, Append[Table[0,{5}],1],70],2] (* Robert A. Russell, May 17 2018 *)
  • PARI
    a(n) = floor((n^2+6)/12);  \\ Washington Bomfim, Jul 03 2012
    
  • PARI
    my(x='x+O('x^70)); concat([0, 0, 0], Vec(x^3/((1-x)*(1-x^2)*(1-x^3)))) \\ Altug Alkan, Oct 14 2015
    
  • SageMath
    [round(n^2/12) for n in range(70)] # G. C. Greubel, Apr 03 2019

Formula

G.f.: x^3/((1-x)*(1-x^2)*(1-x^3)) = x^3/((1-x)^3*(1+x+x^2)*(1+x)).
a(n) = round(n^2/12).
a(n) = floor((n^2+6)/12). - Washington Bomfim, Jul 03 2012
a(-n) = a(n). - Michael Somos, Sep 04 2013
a(n) = a(n-1) + A008615(n-1) for n > 0. - Reinhard Zumkeller, Apr 28 2014
Let n = 6k + m. Then a(n) = n^2/12 + a(m) - m^2/12. Also, a(n) = 3*k^2 + m*k + a(m). Example: a(35) = a(6*5 + 5) = 35^2/12 + a(5) - 5^2/12 = 102 = 3*5^2 + 5*5 + a(5). - Gregory L. Simay, Oct 13 2015
a(n) = a(n-1) +a(n-2) -a(n-4) -a(n-5) +a(n-6), n>5. - Wesley Ivan Hurt, Oct 16 2015
a(n) = A008284(n,3). - Robert A. Russell, May 13 2018
a(n) = A005044(2*n) = A005044(2*n - 3). - Freddy Barrera, Aug 18 2018
a(n) = floor((n^2+k)/12) for all integers k such that 3 <= k <= 7. - Giacomo Guglieri, Apr 03 2019
From Wesley Ivan Hurt, Apr 19 2019: (Start)
a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} 1.
a(n) = Sum_{i=1..floor(n/3)} floor((n-i)/2) - i + 1. (End)
Sum_{n>=3} 1/a(n) = 15/4 + Pi^2/18 - Pi/(2*sqrt(3)) + tanh(Pi/(2*sqrt(3))) * Pi/sqrt(3). - Amiram Eldar, Sep 27 2022
E.g.f.: (8*exp(-x/2)*cos(sqrt(3)*x/2) + (3*x^2 + 3*x - 8)*cosh(x) + (3*x^2 + 3*x + 1)*sinh(x))/36. - Stefano Spezia, Apr 05 2023
From Ridouane Oudra, Dec 12 2024: (Start)
a(n) = (n^2 + 2*gcd(n,3) - 3*gcd(n,2))/12.
a(n) = (A198442(n) + A079978(n))/3.
a(n) = A000212(n) - A002620(n).
a(n) = A008133(n+1) - A307018(n+1). (End)
a(n) = (A309511(n) + A309513(n))/3. - Ray Chandler, Mar 13 2025

A339856 Primitive triples for integer-sided triangles whose sides a < b < c form a geometric progression.

Original entry on oeis.org

4, 6, 9, 9, 12, 16, 16, 20, 25, 25, 30, 36, 25, 35, 49, 25, 40, 64, 36, 42, 49, 49, 56, 64, 49, 63, 81, 49, 70, 100, 49, 77, 121, 64, 72, 81, 64, 88, 121, 81, 90, 100, 81, 99, 121, 81, 117, 169, 81, 126, 196, 100, 110, 121, 100, 130, 169, 121, 132, 144, 121, 143, 169
Offset: 1

Views

Author

Bernard Schott, Dec 19 2020

Keywords

Comments

These triangles are called "geometric triangles" in Project Euler problem 370 (see link).
The triples are displayed in increasing lexicographic order (a, b, c).
Equivalently: triples of integer-sided triangles such that b^2 = a*c with a < c and gcd(a, c) = 1.
When a < b < c are in geometric progression with b = a*q, c = b*q, q is the constant, then 1 < q < (1+sqrt(5))/2 = phi = A001622 = 1.6180... (this bound is used in Maple code).
For each triple (a, b, c), there exists (r, s), 0 < r < s such that a = r^2, b = r*s, c = s^2, q = s/r.
Angle C < 90 degrees if 1 < q < sqrt(phi) and angle C > 90 degrees if sqrt(phi) < q < phi with sqrt(phi) = A139339 = 1.2720...
For k >= 2, each triple (a, b, c) of the form (k^2, k*(k+1), (k+1)^2) is (A008133(3k+1), A008133(3k+2), A008133(3k+3)).
Three geometrical properties about these triangles:
1) The sinus satisfy sin^2(B) = sin(A) * sin(C) with sin(A) < sin(B) < sin(C) that form a geometric progression.
2) The heights satisfy h_b^2 = h_a * h_c with h_c < h_b < h_a that form a geometric progression.
3) b^2 = 2 * R * h_b, with R = circumradius of the triangle ABC.

Examples

			The smallest such triangle is (4, 6, 9) with 4*9 = 6^2.
There exist four triangles with small side = 49 corresponding to triples (49, 56, 64), (49, 63, 81), (49, 70, 100) and (49, 77, 121).
The table begins:
   4,  6,  9;
   9, 12, 16;
  16, 20, 25;
  25, 30, 36;
  25, 35, 49;
  25, 40, 64;
  36, 42, 49;
  ...
		

Crossrefs

Cf. A339857 (smallest side), A339858 (middle side), A339859 (largest side), A339860 (perimeter).
Cf. A336755 (similar for sides in arithmetic progression).
Cf. A335893 (similar for angles in arithmetic progression).
Cf. A001622 (phi), A139339 (sqrt(phi)), A008133.

Programs

  • Maple
    for a from 1 to 300 do
    for b from a+1 to floor((1+sqrt(5))/2 * a) do
    for c from b+1 to floor((1+sqrt(5))/2 * b) do
    k:=a*c;
    if k=b^2 and igcd(a,b,c)=1 then print(a,b,c); end if;
    end do;
    end do;
    end do;
  • PARI
    lista(nn) = {my(phi = (1+sqrt(5))/2); for (a=1, nn, for (b=a+1, floor(a*phi), for (c=b+1, floor(b*phi), if ((a*c == b^2) && (gcd([a,b,c])==1), print([a,b,c])););););} \\ Michel Marcus, Dec 25 2020
    
  • PARI
    upto(n) = my(res=List(), phi = (sqrt(5)+1) / 2); for(i = 2, sqrtint(n), for(j = i+1, (i*phi)\1, if(gcd(i, j)==1, listput(res, [i^2, i*j, j^2])))); concat(Vec(res)) \\ David A. Corneth, Dec 25 2020

Extensions

Data corrected by David A. Corneth, Dec 25 2020

A151842 a(3n) = n, a(3n+1) = 2n+1, a(3n+2) = n+1.

Original entry on oeis.org

0, 1, 1, 1, 3, 2, 2, 5, 3, 3, 7, 4, 4, 9, 5, 5, 11, 6, 6, 13, 7, 7, 15, 8, 8, 17, 9, 9, 19, 10, 10, 21, 11, 11, 23, 12, 12, 25, 13, 13, 27, 14, 14, 29, 15, 15, 31, 16, 16, 33, 17, 17, 35, 18, 18, 37, 19, 19, 39, 20, 20, 41, 21, 21, 43, 22, 22, 45, 23, 23, 47
Offset: 0

Views

Author

Shane Geiger (shane.geiger(AT)gmail.com), Jul 14 2009

Keywords

Comments

Take a list of numbers (like 0,1,2,3,4,5,...) and then pair them up like this: (0,1)(1,2),(2,3),(3,4)... Then sum each pair, and insert the sum between the numbers, like this: (0,1,1), (1,3,2), (2,5,3), ... Finally, remove the parentheses: 0,1,1,1,3,2,2,5,3,...
This mirrors the pattern used to make a dragon curve fractal. You take two points, then find one to insert between them. In the next iteration, you take those three points and find two numbers to insert between them. (Rather than summing the two numbers, a different function is used to find a point relative to two other points.)
a(n) is the number of rises in all compositions of n + 2 with parts in {1,2} and adjacent differences in {-1,1}. - John Tyler Rascoe, Apr 29 2025

Examples

			G.f. = x + x^2 + x^3 + 3*x^4 + 2*x^5 + 2*x^6 + 5*x^7 + 3*x^8 + 3*x^9 + ... - _Michael Somos_, Aug 12 2009
		

Crossrefs

See A076118 for a version with signs.

Programs

  • Magma
    I:=[0,1,1,1,3,2]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..80]]; // Vincenzo Librandi, Feb 14 2015
  • Mathematica
    CoefficientList[Series[x (1 + x) (1 + x^2) / ((x - 1)^2 (1 + x + x^2)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Feb 14 2015 *)
  • PARI
    {a(n) = kronecker(9, n) + (n\3) * [1, 2, 1][n%3 + 1]} /* Michael Somos, Aug 12 2009 */
    
  • Python
    def pairup(x): return [x[i:i+2] for i in range(len(x)-1)]
    def combine(vals): return sum(vals)
    def expand(L,fn): return [(x[0],fn(x),x[1]) for x in pairup(L)]
    L = list(range(20))
    print(expand(L,combine))
    

Formula

From R. J. Mathar, Jul 14 2009: (Start)
G.f.: x*(1+x)*(1+x^2)/((x-1)^2*(1+x+x^2)^2).
a(n) = 2*a(n-3) - a(n-6). (End)
From Michael Somos, Aug 12 2009: (Start)
G.f.: x * (1 - x^4) / ((1 - x) * (1 - x^3)^2).
Euler transform of length 4 sequence [ 1, 0, 2, -1]. (End)
-a(n) = a(-1-n). - Michael Somos, Nov 11 2013
From Ridouane Oudra, Nov 23 2024: (Start)
a(n) = 5*n/6 + n^2/2 - n^3/3 + (2*n^2 - n - 3/2)*floor(n/3) - (3*n + 3/2)*floor(n/3)^2.
a(n) = t(n+2)*t(n+3) - t(n)*t(n+1), where t(n) = floor(n/3) = A002264(n).
a(n) = A008133(n+2) - A008133(n). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, May 10 2025

Extensions

More terms from Vincenzo Librandi, Feb 14 2015

A008217 a(n) = floor(n/4)*floor((n+1)/4).

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 4, 4, 4, 6, 9, 9, 9, 12, 16, 16, 16, 20, 25, 25, 25, 30, 36, 36, 36, 42, 49, 49, 49, 56, 64, 64, 64, 72, 81, 81, 81, 90, 100, 100, 100, 110, 121, 121, 121, 132, 144, 144, 144, 156, 169, 169, 169, 182, 196, 196, 196, 210, 225, 225, 225, 240, 256, 256, 256, 272, 289, 289, 289, 306
Offset: 0

Views

Author

Keywords

Comments

Oblong numbers, squares and quarter-squares are subsequences: a(A004767(n)) = A002378(n); a(A008586(n)) = A000290(n); a(A005408(n)) = A002620(n). - Reinhard Zumkeller, Oct 09 2011

Crossrefs

Programs

  • Haskell
    a008217 n = a008217_list !! n
    a008217_list = zipWith (*) (tail qs) qs where qs = map (`div` 4) [0..]
    -- Reinhard Zumkeller, Oct 09 2011
    
  • Mathematica
    a[n_] := Floor[n/4] * Floor[(n+1)/4]; Array[a, 100, 0] (* Amiram Eldar, May 10 2025 *)
    LinearRecurrence[{2,-2,2,0,-2,2,-2,1},{0,0,0,0,1,1,1,2},80] (* Harvey P. Dale, Aug 18 2025 *)
  • PARI
    a(n) = floor(n/4)*floor((n+1)/4); /* Joerg Arndt, Mar 31 2013 */
    
  • Python
    def A008217(n): return (n>>2)*(n+1>>2) # Chai Wah Wu, Feb 02 2023

Formula

G.f.: -x^4*(x^2-x+1) / ((x-1)^3*(x+1)*(x^2+1)^2). - Colin Barker, Mar 31 2013
From Amiram Eldar, May 10 2025: (Start)
Sum_{n>=4} 1/a(n) = Pi^2/2 + 1.
Sum_{n>=4} (-1)^n/a(n) = Pi^2/6 - 1. (End)

A307018 Total number of parts of size 3 in the partitions of n into parts of size 2 and 3.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 1, 2, 4, 2, 4, 6, 4, 6, 9, 6, 9, 12, 9, 12, 16, 12, 16, 20, 16, 20, 25, 20, 25, 30, 25, 30, 36, 30, 36, 42, 36, 42, 49, 42, 49, 56, 49, 56, 64, 56, 64, 72, 64, 72, 81, 72, 81, 90, 81, 90, 100, 90, 100, 110, 100, 110, 121, 110, 121, 132
Offset: 0

Views

Author

Andrew Ivashenko, Mar 19 2019

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,0,0,1,0,1,2,1];; for n in [9..80] do a[n]:=a[n-2]+2*a[n-3] -2*a[n-5]-a[n-6]+a[n-8]; od; a; # G. C. Greubel, Apr 03 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 80); [0,0,0] cat Coefficients(R!( x^3/((1-x^2)*(1-x^3)^2) )); // G. C. Greubel, Apr 03 2019
    
  • Mathematica
    LinearRecurrence[{0,1,2,0,-2,-1,0,1}, {0,0,0,1,0,1,2,1}, 80] (* G. C. Greubel, Apr 03 2019 *)
    Table[(6n(2+n)-5-27(-1)^n+8(4+3n)Cos[2n Pi/3]-8Sqrt[3]n Sin[2n Pi/3])/216,{n,0,66}] (* Stefano Spezia, Apr 21 2022 *)
  • PARI
    my(x='x+O('x^80)); concat([0,0,0], Vec(x^3/((1-x^2)*(1-x^3)^2))) \\ G. C. Greubel, Apr 03 2019
    
  • Sage
    (x^3/((1-x^2)*(1-x^3)^2)).series(x, 80).coefficients(x, sparse=False) # G. C. Greubel, Apr 03 2019
    

Formula

a(n+2) = A321202(n) - A114209(n+1).
a(3n+1) = A002620(n+2).
a(3n+2) = A002620(n+1).
a(3n+3) = A002620(n+2).
G.f.: x^3/((1+x)*(1+x+x^2)^2*(1-x)^3). - Alois P. Heinz, Mar 19 2019
a(n) = a(n-2) + 2*a(n-3) - 2*a(n-5) - a(n-6) + a(n-8). - G. C. Greubel, Apr 03 2019
a(n) = (6*n*(2 + n) + 8*(4 + 3*n)*cos(2*n*Pi/3) - 8*sqrt(3)*n*sin(2*n*Pi/3) - 5 - 27*(-1)^n)/216. - Stefano Spezia, Apr 21 2022
From Ridouane Oudra, Nov 24 2024: (Start)
a(n) = (7*n/2 - 7*n^2/2 - 9*floor(n/2) + (6*n+4)*floor(2*n/3) + 4*floor(n/3))/18.
a(n) = A008133(n) - A069905(n-1).
a(n) = A002620(A008611(n)). (End)

Extensions

More terms from Alois P. Heinz, Mar 19 2019

A355756 Triangle read by rows: A(n,k) is the intersection number of the Turán graph T(n,k), 1 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 4, 2, 1, 0, 6, 4, 2, 1, 0, 9, 4, 4, 2, 1, 0, 12, 6, 4, 4, 2, 1, 0, 16, 9, 5, 4, 4, 2, 1, 0, 20, 9, 6, 5, 4, 4, 2, 1, 0, 25, 12, 9, 6, 5, 4, 4, 2, 1, 0, 30, 16, 9, 6, 6, 5, 4, 4, 2, 1
Offset: 1

Views

Author

Pontus von Brömssen, Jul 16 2022

Keywords

Examples

			Triangle begins:
  n\k | 1  2  3  4  5  6  7  8  9 10 11
  ----+--------------------------------
   1  | 0
   2  | 0  1
   3  | 0  2  1
   4  | 0  4  2  1
   5  | 0  6  4  2  1
   6  | 0  9  4  4  2  1
   7  | 0 12  6  4  4  2  1
   8  | 0 16  9  5  4  4  2  1
   9  | 0 20  9  6  5  4  4  2  1
  10  | 0 25 12  9  6  5  4  4  2  1
  11  | 0 30 16  9  6  6  5  4  4  2  1
		

Crossrefs

Programs

  • Python
    from networkx import find_cliques,turan_graph
    from itertools import combinations,count
    def A355756(n,k):
        if k==1: return 0
        G=turan_graph(n,k)
        cliques=[sorted(c) for c in find_cliques(G)]
        ne=G.number_of_edges()
        for r in count(1):
            for c0 in combinations(cliques[1:],r-1):
                c=(cliques[0],)+c0
                if len(set().union(e for i in range(r) for e in combinations(c[i],2)))==ne:
                    return r

Formula

A(n,1) = 0.
A(n,2) = floor(n^2/4) = A002620(n).
A(n,3) = floor((n+1)/3)*floor((n+2)/3) = A008133(n+1).
A(n,n-k) = A(2*k,k) for 2 <= k <= n/2.
A(n,n-1) = 2 for n >= 3.
A(n,n) = 1 for n >= 2.
A(n,k) >= floor((n+k-1)/k)*floor((n+k-2)/k) for k >= 2.
Showing 1-6 of 6 results.