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.

A057475 Number of k, 1 <= k <= n, such that gcd(n,k) = gcd(n+1,k) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 3, 2, 4, 3, 4, 5, 3, 4, 8, 5, 6, 7, 5, 5, 10, 7, 7, 9, 8, 8, 12, 7, 8, 15, 10, 9, 11, 8, 12, 17, 11, 9, 16, 11, 12, 19, 11, 11, 22, 15, 14, 17, 13, 15, 24, 17, 14, 17, 15, 17, 28, 15, 16, 29, 17, 18, 24, 15, 20, 31, 21, 15, 24, 23, 24, 35, 19, 19, 28, 18, 24, 31, 22
Offset: 1

Views

Author

Leroy Quet, Sep 27 2000

Keywords

Comments

Number of numbers between 1 and n-1 coprime to n(n+1).
It is conjectured that every positive integer appears. - Jon Perry, Dec 12 2002

Examples

			a(8) = 3 because 1, 5 and 7 are all relatively prime to both 8 and 9.
a(9) counts those numbers coprime to 90, i.e., 1 and 7, hence a(9) = 2.
		

Crossrefs

Programs

  • Magma
    [#[k:k in [1..n]| Gcd(n,k) eq Gcd(n+1,k) and Gcd(n,k) eq 1]: n in [1..80]]; // Marius A. Burtea, Oct 15 2019
  • Maple
    A057475 := proc(n)
        local a,k ;
        a :=  0;
        for k from 1 to n do
            if igcd(k,n) = 1 and igcd(k,n+1)=1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A057475(n),n=1..80) ; # R. J. Mathar, May 13 2025
  • Mathematica
    a[ n_ ] := Length @ Select[ Range[ n ], GCD[ n, # ] == GCD[ n + 1, # ] == 1 & ]; Table[ a[ n ], {n, 80} ] (* Ray Chandler, Dec 06 2006 *)
  • PARI
    newphi(v)=local(vl,fl,np); vl=length(v); np=0; for (s=1,v[1],fl=false; for (r=1,vl,if (gcd(s,v[r])>1,fl=true; break)); if (fl==false,np++)); np
    v=vector(2); for (i=1,500,v[1]=i; v[2]=i+1; print1(newphi(v)","))
    

Formula

From Reinhard Zumkeller, May 02 2006: (Start)
a(A000040(n)-1) = A000010(A000040(n)-1);
a(A000040(n)) = A000010(A000040(n)+1)-1;
a(A118854(n)-1) = a(A118854(n)). (End)
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 2/p^2) = 0.322634... (A065474). - Amiram Eldar, Dec 10 2024
a(n) = A057828(A002378(n)). - Ridouane Oudra, May 30 2025

A124738 Irregular table where the n-th row consists of those positive integers which are coprime to both n and n+1 and which are <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 1, 3, 5, 1, 5, 7, 1, 7, 1, 3, 7, 9, 1, 5, 7, 1, 5, 7, 11, 1, 3, 5, 9, 11, 1, 11, 13, 1, 7, 11, 13, 1, 3, 5, 7, 9, 11, 13, 15, 1, 5, 7, 11, 13, 1, 5, 7, 11, 13, 17, 1, 3, 7, 9, 11, 13, 17, 1, 11, 13, 17, 19, 1, 5, 13, 17, 19, 1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 1, 5, 7, 11, 13
Offset: 1

Views

Author

Leroy Quet, Nov 06 2006

Keywords

Comments

The n-th row has A057475(n) terms.

Examples

			The positive integers which are coprime to 8 and which are <= 8 are 1,3,5,7. The integers which are coprime to 9 and which are <= 9 are 1, The integers in both these sequences (1,5,7) make up the row of A124738.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Select[Range[n], GCD[n, # ] == GCD[n + 1, # ] == 1 &]; Flatten[Table[f[n], {n, 23}]] (* Ray Chandler, Nov 10 2006 *)

Extensions

Extended by Ray Chandler, Nov 10 2006

A124740 a(n) = product of those positive integers which are coprime to both n and n+1 and which are <= n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 15, 35, 7, 189, 35, 385, 1485, 143, 1001, 2027025, 5005, 85085, 459459, 46189, 20995, 1249937325, 1616615, 7436429, 324342711, 71504125, 132793375, 1452095555625, 7436429, 215656441, 6190283353629375, 75969882625
Offset: 1

Views

Author

Leroy Quet, Nov 06 2006

Keywords

Examples

			The positive integers which are coprime to 8 and which are <= 8 are 1,3,5,7. The positive integers which are coprime to 9 and which are <= 9 are 1, 2,4,5,7,8. The integers in both these sequences (1,5,7) are multiplied to get a(8) = 35.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Select[Range[n], GCD[n, # ] == GCD[n + 1, # ] == 1 &];Table[f[n], {n, 33}] (* Ray Chandler, Nov 10 2006 *)

Extensions

Extended by Ray Chandler, Nov 10 2006

A124739 a(n) = sum of those positive integers which are coprime to both n and n+1 and which are <= n.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 9, 13, 8, 20, 13, 24, 29, 25, 32, 64, 37, 54, 61, 61, 55, 110, 73, 91, 111, 108, 114, 168, 91, 120, 225, 170, 153, 199, 144, 216, 305, 221, 175, 320, 211, 252, 397, 261, 249, 506, 337, 342, 423, 351, 403, 624, 433, 410, 483, 431, 493, 812, 421, 480
Offset: 1

Views

Author

Leroy Quet, Nov 06 2006

Keywords

Examples

			The positive integers which are coprime to 8 and which are <= 8 are 1,3,5,7. The integers which are coprime to 9 and which are <= 9 are 1, The integers in both these sequences (1,5,7) are added get a(8) = 13.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ Select[Range[n], GCD[n, # ] == GCD[n + 1, # ] == 1 &];Table[f[n], {n, 60}] (* Ray Chandler, Nov 10 2006 *)

Extensions

Extended by Ray Chandler, Nov 10 2006
Showing 1-4 of 4 results.