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.

This page as a plain text file.
%I A125704 #19 Oct 11 2017 09:16:53
%S A125704 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,
%T A125704 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,
%U A125704 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
%N A125704 Table read by antidiagonals: row n contains the positive integers (in order) which are coprime to the n-th prime.
%H A125704 Michael De Vlieger, <a href="/A125704/b125704.txt">Table of n, a(n) for n = 1..11325</a> (rows 1 <= n <= 150).
%F A125704 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
%F A125704 T(n,m) = m - 1 + floor((m+prime(n)-2)/(prime(n)-1)) where prime(n) = n-th prime. - _Benoit Cloitre_, Jul 11 2009
%e A125704 Beginning of table:
%e A125704   1,  3,  5,  7,  9, 11, 13, ...
%e A125704   1,  2,  4,  5,  7,  8, 10, 11, ...
%e A125704   1,  2,  3,  4,  6,  7,  8,  9, 11, ...
%e A125704   1,  2,  3,  4,  5,  6,  8,  9, 10, ...
%p A125704 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
%t A125704 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_ *)
%o A125704 (PARI) T(n,m)=m-1+floor((m+prime(n)-2)/(prime(n)-1)) \\ _Benoit Cloitre_, Jul 11 2009
%K A125704 nonn,tabl
%O A125704 1,3
%A A125704 _Leroy Quet_, Jan 31 2007
%E A125704 More terms from _R. J. Mathar_, Feb 02 2007