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.

A023022 Number of partitions of n into two relatively prime parts. After initial term, this is the "half-totient" function phi(n)/2 (A000010(n)/2).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 2, 5, 2, 6, 3, 4, 4, 8, 3, 9, 4, 6, 5, 11, 4, 10, 6, 9, 6, 14, 4, 15, 8, 10, 8, 12, 6, 18, 9, 12, 8, 20, 6, 21, 10, 12, 11, 23, 8, 21, 10, 16, 12, 26, 9, 20, 12, 18, 14, 29, 8, 30, 15, 18, 16, 24, 10, 33, 16, 22, 12, 35, 12, 36, 18, 20, 18, 30, 12, 39, 16, 27, 20, 41, 12
Offset: 2

Views

Author

Keywords

Comments

The number of distinct linear fractional transformations of order n. Also the half-totient function can be used to construct a tree containing all the integers. On the zeroth rank we have just the integers 1 and 2: immediate "ancestors" of 1 and 2 are (1: 3,4,6 2: 5,8,10,12) etc. - Benoit Cloitre, Jun 03 2002
Moebius transform of floor(n/2). - Paul Barry, Mar 20 2005
Also number of different kinds of regular n-gons, one convex, the others self-intersecting. - Reinhard Zumkeller, Aug 20 2005
From Artur Jasinski, Oct 28 2008: (Start)
Degrees of minimal polynomials of cos(2*Pi/n). The first few are
1: x - 1
2: x + 1
3: 2*x + 1
4: x
5: 4*x^2 + 2*x - 1
6: 2*x - 1
7: 8*x^3 + 4*x^2 - 4*x - 1
8: 2*x^2 - 1
9: 8*x^3 - 6*x + 1
10: 4*x^2 - 2*x - 1
11: 32*x^5 + 16*x^4 - 32*x^3 - 12*x^2 + 6*x + 1
These polynomials have solvable Galois groups, so their roots can be expressed by radicals. (End)
a(n) is the number of rationals p/q in the interval [0,1] such that p + q = n. - Geoffrey Critzer, Oct 10 2011
It appears that, for n > 2, a(n) = A023896(n)/n. Also, it appears that a record occurs at n > 2 in this sequence if and only if n is a prime. For example, records occur at n=5, 7, 11, 13, 17, ..., all of which are prime. - John W. Layman, Mar 26 2012
From Wolfdieter Lang, Dec 19 2013: (Start)
a(n) is the degree of the algebraic number of s(n)^2 = (2*sin(Pi/n))^2, starting at a(1)=1. s(n) = 2*sin(Pi/n) is the length ratio side/R for a regular n-gon inscribed in a circle of radius R (in some length units). For the coefficient table of the minimal polynomials of s(n)^2 see A232633.
Because for even n, s(n)^2 lives in the algebraic number field Q(rho(n/2)), with rho(k) = 2*cos(Pi/k), the degree is a(2*l) = A055034(l). For odd n, s(n)^2 is an integer in Q(rho(n)), and the degree is a(2*l+1) = A055034(2*l+1) = phi(2*l+1)/2, l >= 1, with Euler's totient phi=A000010 and a(1)=1. See also A232631-A232633.
(End)
Also for n > 2: number of fractions A182972(k)/A182973(k) such that A182972(k) + A182973(k) = n, A182972(n) and A182973(n) provide an enumeration of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator. - Reinhard Zumkeller, Jul 30 2014
Number of distinct rectangles with relatively prime length and width such that L + W = n, W <= L. For a(17)=8; the rectangles are 1 X 16, 2 X 15, 3 X 14, 4 X 13, 5 X 12, 6 X 11, 7 X 10, 8 X 9. - Wesley Ivan Hurt, Nov 12 2017
After including a(1) = 1, the number of elements of any reduced residue system mod* n used by Brändli and Beyne is a(n). See the examples below. - Wolfdieter Lang, Apr 22 2020
a(n) is the number of ABC triples with n = c. - Felix Huber, Oct 12 2023

Examples

			a(15)=4 because there are 4 partitions of 15 into two parts that are relatively prime: 14 + 1, 13 + 2, 11 + 4, 8 + 7. - _Geoffrey Critzer_, Jan 25 2015
The smallest nonnegative reduced residue system mod*(n) for n = 1 is {0}, hence a(1) = 1; for n = 9 it is {1, 2, 4}, because 5 == 4 (mod* 9) since -5 == 4 (mod 9), 7 == 2 (mod* 9) and 8 == 1 (mod* 9). Hence a(9) = phi(9)/2 = 3. See the comment on Brändli and Beyne above. - _Wolfdieter Lang_, Apr 22 2020
		

References

  • G. Pólya and G. Szegő, Problems and Theorems in Analysis I (Springer 1924, reprinted 1972), Part Eight, Chap. 1, Sect. 6, Problems 60&61.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a023022 n = length [(u, v) | u <- [1 .. div n 2],
                                 let v = n - u, gcd u v == 1]
    -- Reinhard Zumkeller, Jul 30 2014
    
  • Magma
    [1] cat [EulerPhi(n)/ 2: n in [3..100]]; // Vincenzo Librandi, Aug 19 2018
  • Maple
    A023022 := proc(n)
        if n =2 then
            1;
        else
            numtheory[phi](n)/2 ;
        end if;
    end proc:
    seq(A023022(n),n=2..60) ; # R. J. Mathar, Sep 19 2017
  • Mathematica
    Join[{1}, Table[EulerPhi[n]/2, {n, 3, 100}]] (* adapted by Vincenzo Librandi, Aug 19 2018 *)
  • PARI
    a(n)=if(n<=2,1,eulerphi(n)/2);
    /* for printing minimal polynomials of cos(2*Pi/n) */
    default(realprecision,110);
    for(n=1,33,print(n,": ",algdep(cos(2*Pi/n),a(n))));
    
  • Python
    from sympy.ntheory import totient
    def a(n): return 1 if n<3 else totient(n)/2 # Indranil Ghosh, Mar 30 2017
    

Formula

a(n) = phi(n)/2 for n >= 3.
a(n) = (1/n)*Sum_{k=1..n-1, gcd(n, k)=1} k = A023896(n)/n for n>2. - Reinhard Zumkeller, Aug 20 2005
G.f.: x*(x - 1)/2 + (1/2)*Sum_{k>=1} mu(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Apr 13 2017
a(n) = Sum_{d|n} moebius(n/d)*floor(d/2). - Michel Marcus, May 25 2021

Extensions

This was in the 1973 "Handbook", but then was dropped from the database. Resubmitted by David W. Wilson
Entry revised by N. J. A. Sloane, Jun 10 2012
Polynomials edited with the consent of Artur Jasinski by Wolfdieter Lang, Jan 08 2011
Name clarified by Geoffrey Critzer, Jan 25 2015

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

A113751 Number of diagonal rectangles with corners on an n X n grid of points.

Original entry on oeis.org

0, 0, 1, 8, 30, 88, 199, 408, 748, 1280, 2053, 3168, 4666, 6712, 9363, 12728, 16952, 22256, 28681, 36536, 45870, 56936, 69967, 85264, 102860, 123232, 146557, 173128, 203138, 237192, 275243, 318104, 365856, 418912, 477649, 542392, 613406, 691848
Offset: 1

Views

Author

T. D. Noe, Nov 09 2005

Keywords

Comments

The diagonal rectangles are the ones whose sides are not parallel to the grid axes. All the rectangles can be reflected so that the slope of one side is >= 1. There are a total of A046657(n-1) these slopes. These slopes are the basis of the Mathematica program that counts the rectangles.

Examples

			a(3) = 1 because for the 3 X 3 grid, there is only one diagonal rectangle - a square having sides sqrt(2) units.
a(4) = 8 because for the 4 X 4 grid, there are 4 squares having sides sqrt(2) units, 2 squares having sides sqrt(5) units and 2 rectangles that are sqrt(2) by 2*sqrt(2) units.
		

Crossrefs

Cf. A000537 (parallel rectangles on an n X n grid), A085582 (all rectangles on an n X n grid).

Programs

  • Mathematica
    Table[n=m-1; slopes=Union[Flatten[Table[a/b, {b, n}, {a, b, n-b}]]]; rects=0; Do[b=Numerator[slopes[[i]]]; a=Denominator[slopes[[i]]]; base={a+b, a+b}; l=0; While[l++; k=l; While[extent=base+{b, a}(k-1)+{a, b}(l-1); extent[[1]]<=n && extent[[2]]<=n, pos={n+1, n+1}-extent; If[a==b && k==l, fact=1, If[pos[[1]]==pos[[2]], fact=2, fact=4]]; rects=rects+fact*Times@@pos; k++ ]; k>l], {i, Length[slopes]}]; rects, {m, 1, 42}]

Formula

a(n) = A085582(n) - A000537(n-1). [corrected by David Radcliffe, Feb 06 2020]

Extensions

a(1) = 0 prepended by Jinyuan Wang, Feb 06 2020

A115000 a(n) = J_2(n) / 24.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 5, 4, 7, 6, 8, 8, 12, 9, 15, 12, 16, 15, 22, 16, 25, 21, 27, 24, 35, 24, 40, 32, 40, 36, 48, 36, 57, 45, 56, 48, 70, 48, 77, 60, 72, 66, 92, 64, 98, 75, 96, 84, 117, 81, 120, 96, 120, 105, 145, 96, 155, 120, 144, 128, 168, 120, 187, 144, 176, 144, 210, 144
Offset: 5

Views

Author

Keywords

Comments

The Jordan function J_m(n) can be defined as multiplicative with J_m(p^e) = (p^m-1)*p^(m*(e-1)). Cf. A059379.
Looking at the sequences J_m(n) for fixed m, one is struck by the fact that all but a few early terms have a common factor, given in A079612. I will refer to this sequence as K(n), following the notation in the paper by Vaughan and Wooley. (The alternate lambda^*(n) in the comment for A006863 is too awkward.)
In fact, K(m) not only divides J_m(n) for all but finitely many n; it also divides Sum_{k=1..n} J_m(k) for all but finitely many n.
J_1(n) = phi(n) and phi(n)/2 and Sum_{k=1..n} phi(n)/2 are A023022 and A046657.
The weight of the n-th elliptic division polynomial -- the analog of cyclotomic polynomials for elliptic divisibility sequences. That is, let e1 = b1, e2 = b2*b1, e3 = b3*b1, e4 = b2*b4*b1, e5 = (b2^4*b4 - b3^3)*b1 = b5*e1 and so on be an elliptic divisibility sequence. Let c2 = b2^4*b4, c3 = b3^3, c4 = b4^2 and cn = bn for n>4. Then c5 = c2 - c3, c6 = c5 - c4, c7 = c6*c3 - c5*c4 and so on. Let the weight of c2, c3, c4 each be 1 and weight of a product is sum of the weights of the factors. The weight of cn is a(n) for n>4. - Michael Somos, Aug 12 2008

Examples

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

Crossrefs

Cf. A007434.

Programs

  • Magma
    function a(n) return n lt 5 select 0 else Dimension( ModularForms( Gamma1(n), 2)) - Dimension( ModularForms( Gamma1(n), 1)); end function; /* Michael Somos, Aug 05 2014 */
  • Mathematica
    a[n_] := DivisorSum[n, #^2*MoebiusMu[n/#]&]/24; Table[a[n], {n, 5, 80}] (* Jean-François Alcover, Dec 07 2015, adapted from PARI *)
  • PARI
    {a(n) = if( n<5, 0, sumdiv(n, d, d^2 * moebius(n / d)) / 24)}; /* Michael Somos, Aug 12 2008 */
    

Formula

A007434(n) = 24 * a(n) unless n<5. - Michael Somos, Aug 12 2008

Extensions

More terms from Michael Somos, Aug 12 2008

A049703 a(0) = 0; for n>0, a(n) = A005598(n)/2.

Original entry on oeis.org

0, 1, 2, 4, 7, 12, 18, 27, 38, 52, 68, 89, 112, 141, 173, 209, 249, 297, 348, 408, 472, 542, 617, 703, 793, 893, 999, 1114, 1235, 1370, 1509, 1663, 1825, 1997, 2177, 2369, 2567, 2783, 3008, 3245, 3490, 3755, 4026, 4318
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    A049703:= func< n | n eq 0 select 0 else (1 +(&+[(n-j+1)*EulerPhi(j): j in [1..n]]))/2 >;
    [A049703(n): n in [0..60]]; // G. C. Greubel, Dec 08 2022
    
  • Mathematica
    A005598[n_]:= A005598[n]= 1 +Sum[(n-j+1)*EulerPhi[j], {j,n}];
    A049703[n_]:= If[n==0, 0, A005598[n]/2];
    Table[A049703[n], {n,0,50}] (* G. C. Greubel, Dec 08 2022 *)
  • SageMath
    @CachedFunction
    def A049703(n): return 0 if (n==0) else (1 + sum((n-j+1)*euler_phi(j) for j in range(1,n+1)))/2
    [A049703(n) for n in range(61)] # G. C. Greubel, Dec 08 2022

Formula

a(n) = (1/2)*Sum_{j=0..n} T(j, n-j), for array T in A049695.
a(n) = (1/2)*(1 + (n+1)*A002088(n) - A011755(n)), with a(0) = 0. - G. C. Greubel, Dec 08 2022

Extensions

Edited by N. J. A. Sloane, Apr 04 2007.

A180360 Table t(n,k) is the number of ways to partition 1 into k fractions using the Farey fractions of order n, read row by row.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 5, 4, 2, 1, 1, 6, 6, 5, 3, 1, 1, 9, 10, 8, 5, 2, 1, 1, 11, 14, 13, 10, 6, 3, 1, 1, 14, 20, 22, 21, 15, 9, 4, 1, 1, 16, 26, 36, 39, 33, 22, 11, 4, 1, 1, 21, 36, 47, 49, 40, 27, 14, 6, 2, 1, 1, 23, 44, 70, 87, 89, 76, 53, 31, 14, 5, 1, 1, 29, 58, 88, 105, 103, 87
Offset: 1

Views

Author

Robert G. Wilson v, Aug 30 2010

Keywords

Comments

...
..1
..1...1
..1...2...1
..1...3...2...1
..1...5...4...2...1
..1...6...6...5...3...1
..1...9..10...8...5...2...1
..1..11..14..13..10...6...3...1
..1..14..20..22..21..15...9...4...1
..1..16..26..36..39..33..22..11...4...1
..1..21..36..47..49..40..27..14...6...2...1
..1..23..44..70..87..89..76..53..31..14...5...1
..1..29..58..88.105.103..87..60..36..17...7...2...1
...

Examples

			t(6,3) = 6 because 1 = 2/3+1/6+1/6 = 3/5+1/5+1/5 = 1/2+1/3+1/6 = 1/2+1/4+1/4 = 2/5+2/5+1/5 = 1/3+1/3+1/3.
		

Crossrefs

Row sum A119983, first column and main diagonal A000012, second column A046657.

Programs

  • Mathematica
    Farey[n_] := Union@ Flatten@ Table[a/b, {b, n}, {a, b}]; t[n_, k_] := Length@ IntegerPartitions[1, {k}, Farey@ n]; Table[ t[n, k], {n, 13}, {k, n}] // Flatten
Showing 1-6 of 6 results.