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.

A175549 Number of triples (a, b, c) with gcd(a, b, c) = 1 and -n <= a,b,c <= n.

Original entry on oeis.org

0, 26, 98, 290, 578, 1154, 1730, 2882, 4034, 5762, 7490, 10370, 12674, 16706, 20162, 24770, 29378, 36290, 41474, 50114, 57026, 66242, 74882, 87554, 96770, 111170, 123266, 138818, 152642, 172802, 186626, 209666, 228098, 251138, 271874, 299522
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[n>0, 8 * Sum[MoebiusMu[k] * ((Floor[n/k] + 1)^3 - 1), {k, 1, n}] - 24 * Sum[EulerPhi[k], {k, 1, n}] - 6, 0], {n, 0, 35}] (* Indranil Ghosh, Mar 11 2017 *)
  • PARI
    a(n)=if(n>0,8*sum(k=1,n,moebius(k)*((n\k+1)^3-1))-24*sum(k=1,n,eulerphi(k))-6)
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A175549(n):
        if n == 0:
            return 0
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A175549(k1)
            j, k1 = j2, n//j2
        return 4*n*(n - 1)*(2*n + 5)-c+26*(j-1)# Chai Wah Wu, Mar 30 2021

Formula

For n > 0, a(n) = 8*A090025(n) - 12*A018805(n) - 18.
a(n) = 2*n*(4*n^2 + 6*n + 3) - Sum_{j=2..n} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021

Extensions

Edited by Charles R Greathouse IV, Jul 19 2010