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.

A124823 a(n) = n-th integer from among those positive integers which are coprime to n(n+1)/2.

Original entry on oeis.org

1, 2, 7, 9, 8, 10, 15, 23, 16, 13, 35, 37, 16, 31, 53, 33, 26, 28, 49, 83, 40, 25, 71, 89, 33, 41, 95, 67, 56, 58, 63, 103, 58, 53, 151, 109, 40, 64, 157, 101, 73, 74, 95, 179, 88, 49, 143, 167, 71, 98, 175, 113, 80, 109, 173, 199, 92, 61, 223, 227, 64, 110, 221, 173, 142
Offset: 1

Views

Author

Leroy Quet, Nov 08 2006

Keywords

Examples

			The positive integers which are coprime to (5*6/2)=15 are 1,2,4,7,8,11,13,14... The fifth of these integers is 8, so a(5) = 8.
		

Crossrefs

Cf. A124822.

Programs

  • Maple
    f:= proc(n) local t,k, count;
        t:= n*(n+1)/2; count:= 0;
        for k from 1 do
          if igcd(k,t)=1 then count:= count+1; if count = n then return k fi fi
        od
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 29 2018
  • Mathematica
    f[n_] := Block[{k = 0, c = n},While[c > 0,k++;While[GCD[n*(n + 1)/2, k] > 1, k++ ];c--;];k];Table[f[n], {n, 65}] (* Ray Chandler, Nov 10 2006 *)

Extensions

Extended by Ray Chandler, Nov 10 2006