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.

A085599 Number of pairs of coprimes (n-i,n+i), 1

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 06 2003

Keywords

Examples

			n=7: (7-2,7+2)=(5,9), (7-3,7+3)=(4,10), (7-4,7+4)=(3,11), (7-5,7+5)=(2,12), (7-6,7+6)=(1,13): only three are coprime: (5,9), (3,11) and (1,13), therefore a(7)=3.
		

Crossrefs

Programs

  • Maple
    A085599 := proc(n)
        local i,a;
        a := 0 ;
        for i from 2 to n-1 do
            if igcd(n-i,n+i) = 1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 09 2016

Formula

For n>1, a(n) = A055034(n) - ((-1)^n + 1)/2 = A000010(2*n)/2 - ((-1)^n + 1)/2. - Max Alekseyev, Jul 21 2016

Extensions

Definition corrected by Ray Chandler, Jul 09 2016