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.

A125704 Table read by antidiagonals: row n contains the positive integers (in order) which are coprime to the n-th prime.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Jan 31 2007

Keywords

Examples

			Beginning of table:
  1,  3,  5,  7,  9, 11, 13, ...
  1,  2,  4,  5,  7,  8, 10, 11, ...
  1,  2,  3,  4,  6,  7,  8,  9, 11, ...
  1,  2,  3,  4,  5,  6,  8,  9, 10, ...
		

Programs

  • Maple
    A125704 := proc(n,m) local p,i,a ; p := ithprime(n) ; a := 1 ; for i from 2 to m do a := a+1 ; while gcd(a,p) <> 1 do a := a+1 ; od ; od ; RETURN(a) ; end : maxdiag := 15 ; for d from 1 to maxdiag do for n from d to 1 by -1 do printf("%d,",A125704(n,d-n+1)) ; od ; od; # R. J. Mathar, Feb 02 2007
  • Mathematica
    Table[Function[n, k - 1 + Floor[(k + Prime[n] - 2)/(Prime[n] - 1)]][m - k + 1], {m, 14}, {k, m}] // Flatten (* Michael De Vlieger, Oct 10 2017, after PARI by Benoit Cloitre *)
  • PARI
    T(n,m)=m-1+floor((m+prime(n)-2)/(prime(n)-1)) \\ Benoit Cloitre, Jul 11 2009

Formula

T(1,m) = A005408(m). T(2,m) = A001651(m). T(3,m) = A047201(m). T(4,m) = A047304(m). - R. J. Mathar, Feb 02 2007
T(n,m) = m - 1 + floor((m+prime(n)-2)/(prime(n)-1)) where prime(n) = n-th prime. - Benoit Cloitre, Jul 11 2009

Extensions

More terms from R. J. Mathar, Feb 02 2007