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

A015631 Number of ordered triples of integers from [ 1..n ] with no global factor.

Original entry on oeis.org

1, 3, 8, 15, 29, 42, 69, 95, 134, 172, 237, 287, 377, 452, 552, 652, 804, 915, 1104, 1252, 1450, 1635, 1910, 2106, 2416, 2674, 3007, 3301, 3735, 4027, 4522, 4914, 5404, 5844, 6432, 6870, 7572, 8121, 8805, 9389, 10249, 10831, 11776, 12506
Offset: 1

Views

Author

Keywords

Comments

Number of integer-sided triangles with at least two sides <= n and sides relatively prime. - Henry Bottomley, Sep 29 2006

Examples

			a(4) = 15 because the 15 triples in question are in lexicographic order: [1,1,1], [1,1,2], [1,1,3], [1,1,4], [1,2,2], [1,2,3], [1,2,4], [1,3,3], [1,3,4], [1,4,4], [2,2,3], [2,3,3], [2,3,4], [3,3,4] and [3,4,4]. - _Wolfdieter Lang_, Apr 04 2013
The a(4) = 15 triangles with at least two sides <= 4 and sides relatively prime (see _Henry Bottomley_'s comment above) are: [1,1,1], [1,2,2], [2,2,3], [1,3,3], [2,3,3], [2,3,4], [3,3,4], [3,3,5], [1,4,4], [2,4,5], [3,4,4], [3,4,5], [3,4,6], [4,4,5], [4,4,7]. - _Alois P. Heinz_, Feb 14 2020
		

Crossrefs

Programs

  • Magma
    [n eq 1 select 1 else Self(n-1)+ &+[MoebiusMu(n div d) *d*(d+1)/2:d in Divisors(n)]:n in [1..50]]; // Marius A. Burtea, Feb 14 2020
    
  • Maple
    with(numtheory):
    b:= proc(n) option remember;
           add(mobius(n/d)*d*(d+1)/2, d=divisors(n))
        end:
    a:= proc(n) option remember;
          b(n) + `if`(n=1, 0, a(n-1))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 09 2011
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Sum[MoebiusMu[n/d]*d*(d+1)/2, {d, Divisors[n]}] + a[n-1]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Jan 20 2014, after Maple *)
    Accumulate[Table[Sum[MoebiusMu[n/d]*d*(d + 1)/2, {d, Divisors[n]}], {n, 1, 50}]] (* Vaclav Kotesovec, Jan 31 2019 *)
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, moebius(k/d)*binomial(d+1, 2))); \\ Seiichi Manyama, Jun 12 2021
    
  • PARI
    a(n) = binomial(n+2, 3)-sum(k=2, n, a(n\k)); \\ Seiichi Manyama, Jun 12 2021
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, moebius(k)*x^k/(1-x^k)^3)/(1-x)) \\ Seiichi Manyama, Jun 12 2021
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A015631(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A015631(k1)
            j, k1 = j2, n//j2
        return n*(n-1)*(n+4)//6-c+j # Chai Wah Wu, Mar 30 2021
    

Formula

a(n) = (A071778(n)+3*A018805(n)+2)/6. - Vladeta Jovovic, Dec 01 2004
Partial sums of the Moebius transform of the triangular numbers (A007438). - Steve Butler, Apr 18 2006
a(n) = 2*A123324(n) - A046657(n) for n>1. - Henry Bottomley, Sep 29 2006
Row sums of triangle A134543. - Gary W. Adamson, Oct 31 2007
a(n) ~ n^3 / (6*Zeta(3)). - Vaclav Kotesovec, Jan 31 2019
G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k) * x^k / (1 - x^k)^3. - Ilya Gutkovskiy, Feb 14 2020
a(n) = n*(n+1)*(n+2)/6 - Sum_{j=2..n} a(floor(n/j)) = A000292(n) - Sum_{j=2..n} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021

A123323 Number of integer-sided triangles with maximum side n, with sides relatively prime.

Original entry on oeis.org

1, 1, 3, 4, 8, 7, 15, 14, 21, 20, 35, 26, 48, 39, 52, 52, 80, 57, 99, 76, 102, 95, 143, 100, 160, 132, 171, 150, 224, 148, 255, 200, 250, 224, 300, 222, 360, 279, 348, 296, 440, 294, 483, 370, 444, 407, 575, 392, 609, 460, 592, 516, 728, 495, 740, 588, 738, 644
Offset: 1

Views

Author

Keywords

Comments

Number of triples a,b,c with a <= b <= c < a+b, gcd(a,b,c) = 1 and c = n.
Dropping the requirement for side lengths to be relatively prime this sequence becomes A002620 (with a different offset). See the Sep 2006 comment in A002620. - Peter Munn, Jul 26 2017

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> add(mobius(n/d)*floor((d+1)^2/4), d=divisors(n)):
    seq(a(n), n=1..60);  # Alois P. Heinz, Oct 23 2013
  • Mathematica
    a[n_] := DivisorSum[n, Floor[(#+1)^2/4]*MoebiusMu[n/#]&]; Array[a, 60] (* Jean-François Alcover, Dec 07 2015 *)
  • PARI
    A123323(n)=sumdiv(n,d,floor((d+1)^2/4)*moebius(n/d))

Formula

Moebius transform of b(n) = floor((n+1)^2/4).
G.f.: (G(x)+x-x^2)/2, where G(x) = Sum_{k >= 1} mobius(k)*x^k*(1+2*x^k-x^(2*k))/(1-x^k)^2/(1-x^(2*k)).

A124325 Number of blocks of size >1 in all partitions of an n-set.

Original entry on oeis.org

0, 0, 1, 4, 17, 76, 362, 1842, 9991, 57568, 351125, 2259302, 15288000, 108478124, 805037105, 6233693772, 50257390937, 421049519856, 3659097742426, 32931956713294, 306490813820239, 2945638599347760, 29198154161188501
Offset: 0

Views

Author

Emeric Deutsch, Oct 28 2006

Keywords

Comments

Sum of the first entries in all blocks of all set partitions of [n-1]. a(4) = 17 because the sum of the first entries in all blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 1+4+3+3+6 = 17. - Alois P. Heinz, Apr 24 2017

Examples

			a(3) = 4 because in the partitions 123, 12|3, 13|2, 1|23, 1|2|3 we have four blocks of size >1.
		

Crossrefs

Column k=2 of A283424.

Programs

  • Maple
    with(combinat): c:=n->bell(n+1)-bell(n)-n*bell(n-1): seq(c(n),n=0..23);
  • Mathematica
    nn=22;Range[0,nn]!CoefficientList[Series[(Exp[x]-1-x)Exp[Exp[x]-1],{x,0,nn}],x]  (* Geoffrey Critzer, Mar 28 2013 *)
  • PARI
    N = 66;  x = 'x + O('x^N);
    egf = (exp(x)-1-x)*exp(exp(x)-1) + 'c0;
    gf = serlaplace(egf);
    v = Vec(gf);  v[1]-='c0;  v
    /* Joerg Arndt, Mar 29 2013 */

Formula

a(n) = B(n+1)-B(n)-n*B(n-1), where B(q) are the Bell numbers (A000110).
E.g.f.: (exp(z)-1-z)*exp(exp(z)-1).
a(n) = Sum_{k=0..floor(n/2)} k*A124324(n,k).
a(n) = A285595(n-1,1). - Alois P. Heinz, Apr 24 2017
a(n) = Sum_{k=1..n*(n-1)/2} k * A124327(n-1,k) for n>1. - Alois P. Heinz, Dec 05 2023

A123325 Number of distinct angles in all integer-sided triangles with all sides <= n.

Original entry on oeis.org

1, 3, 9, 17, 35, 49, 82, 109, 149, 188, 262, 316, 419, 500, 607, 698, 876, 1004, 1222, 1383, 1589, 1782, 2108, 2318, 2634, 2914, 3253, 3564, 4088, 4411, 5000, 5392, 5917, 6410, 6995, 7468, 8308, 8926, 9661, 10268, 11313, 11976, 13136, 13951, 14875
Offset: 1

Views

Author

Keywords

Comments

Using the law of cosines, the angle A opposite side a has cos A = (b^2 + c^2 - a^2) / (2bc) and the cosine uniquely identifies an angle of a triangle.

Crossrefs

Programs

  • PARI
    A123325(n)=local(i,j,k,l); r=0; l=listcreate(n^3); for(i=1,n, for(j=1,n, for(k=1,n, if(gcd(i,gcd(j,k))==1&&2*max(i,max(j,k))
    				
Showing 1-4 of 4 results.