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-3 of 3 results.

A069213 a(n) = n-th positive integer relatively prime to n.

Original entry on oeis.org

1, 3, 4, 7, 6, 17, 8, 15, 13, 23, 12, 35, 14, 31, 28, 31, 18, 53, 20, 49, 37, 47, 24, 71, 31, 55, 40, 65, 30, 109, 32, 63, 53, 71, 51, 107, 38, 79, 62, 99, 42, 145, 44, 95, 83, 95, 48, 143, 57, 123, 80, 111, 54, 161, 74, 129, 89, 119, 60, 223, 62, 127, 109, 127, 87, 217
Offset: 1

Views

Author

Leroy Quet, Apr 11 2002

Keywords

Comments

Smallest k such there are exactly n integers among (1,2,3,4,...,k) relatively prime to n. - Benoit Cloitre, Jun 09 2002

Examples

			6 is relatively prime to 1, 5, 7, 11, 13, 17,..., the 6th term of this sequence being 17, so a(6) = 17.
		

Crossrefs

Final term of n-th row of A077581.
Cf. A077582.

Programs

  • Haskell
    a069213 = last . a077581_row  -- Reinhard Zumkeller, Sep 26 2014
  • Mathematica
    f[n_] := Block[{c = 0, k = 1}, While[c < n, If[CoprimeQ[k, n], c++ ]; k++ ]; k - 1]; Array[f, 66] (* Robert G. Wilson v, Sep 10 2008 *)
    Table[Position[CoprimeQ[Range[300],n],True,1,n][[-1]],{n,70}]//Flatten (* Harvey P. Dale, Aug 14 2020 *)
  • PARI
    for(n=1,100,s=1; while(sum(i=1,s,if(gcd(n,i)-1,0,1))
    				

Formula

a(p) = p+1, p is a prime, a(2^n)= 2^(n+1) - 1. What are a(pq), a(pqr), a(n) where n the product of first k primes? - Amarnath Murthy, Nov 14 2002
Let the remainder when n is divided by phi(n) be r and the quotient be k. I.e., n = k*phi(n) + r. Then k*n + r < a(n) < (k+1)*n. If the phi(n) numbers be arranged in increasing order and if the r-th number is m then a(n) = k*n + m. - Amarnath Murthy, Jul 07 2002

A077581 Triangle in which row n contains the n smallest numbers starting from 1 and coprime to n.

Original entry on oeis.org

1, 1, 3, 1, 2, 4, 1, 3, 5, 7, 1, 2, 3, 4, 6, 1, 5, 7, 11, 13, 17, 1, 2, 3, 4, 5, 6, 8, 1, 3, 5, 7, 9, 11, 13, 15, 1, 2, 4, 5, 7, 8, 10, 11, 13, 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Offset: 1

Views

Author

Amarnath Murthy, Nov 14 2002

Keywords

Comments

A247815 and A247892 give number of primes and nonprimes per row. - Reinhard Zumkeller, Sep 26 2014

Examples

			1;
1,  3;
1,  2,  4;
1,  3,  5,  7;
1,  2,  3,  4,  6;
1,  5,  7, 11, 13, 17;
1,  2,  3,  4,  5,  6,  8;
1,  3,  5,  7,  9, ...
		

Crossrefs

Cf. A247798 (central terms), A247815, A247892.
Cf. A077664.

Programs

  • Haskell
    a077581 n k = a077581_tabl !! (n-1) !! (k-1)
    a077581_row n = a077581_tabl !! (n-1)
    a077581_tabl = map (\x -> take x [z | z <- [1..], gcd x z == 1]) [1..]
    -- Reinhard Zumkeller, Sep 26 2014
  • Mathematica
    row[n_] := Take[Select[Range[n^2], GCD[ #, n]==1&], n]; Join@@row/@Range[13]

Extensions

More terms from Sascha Kurz, Jan 11 2003

A247892 Number of nonprimes in n-th row of triangle A077581.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 26 2014

Keywords

Comments

a(n) = n - A247815(n)

Crossrefs

Programs

  • Haskell
    a247892 n = n - a247815 n
Showing 1-3 of 3 results.