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.

A046657 a(n) = A002088(n)/2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 11, 14, 16, 21, 23, 29, 32, 36, 40, 48, 51, 60, 64, 70, 75, 86, 90, 100, 106, 115, 121, 135, 139, 154, 162, 172, 180, 192, 198, 216, 225, 237, 245, 265, 271, 292, 302, 314, 325, 348, 356, 377, 387, 403, 415, 441, 450, 470, 482
Offset: 2

Views

Author

Keywords

Comments

a(n) = |{(x,y) : 1 <= x <= y <= n, x + y <= n, 1 = gcd(x,y)}| = |{(x,y) : 1 <= x <= y <= n, x + y > n, 1 = gcd(x,y)}|. - Steve Butler, Mar 31 2006
Brousseau proved that if the starting numbers of a generalized Fibonacci sequence are <= n (for n > 1) then the number of such sequences with relatively prime successive terms is a(n). - Amiram Eldar, Mar 31 2017

Crossrefs

Cf. A002088.
Partial sums of A023022.

Programs

  • GAP
    List([2..60],n->Sum([1..n],k->Phi(k)/2)); # Muniru A Asiru, Mar 05 2018
    
  • Maple
    a:=n->sum(numtheory[phi](k),k=1..n): seq(a(n)/2, n=2..60); # Muniru A Asiru, Mar 05 2018
  • Mathematica
    Rest@ Accumulate[EulerPhi@ Range@ 56]/2 (* Michael De Vlieger, Apr 02 2017 *)
  • PARI
    a(n) = sum(k=1, n, eulerphi(k))/2; \\ Michel Marcus, Apr 01 2017
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A046657(n): # based on second formula in A018805
        if n == 0:
            return 0
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(4*A046657(k1)-1)
            j, k1 = j2, n//j2
        return (n*(n-1)-c+j)//4 # Chai Wah Wu, Mar 25 2021

Formula

a(n) = 1/2 + Sum_{iJoseph Wheat, Feb 22 2018