[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A078401
Triangle read by rows: T(n,k) = number of numbers <= k that are coprime to n, 1 <= k <= n.
2
1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 2, 3, 4, 4, 1, 1, 1, 1, 2, 2, 1, 2, 3, 4, 5, 6, 6, 1, 1, 2, 2, 3, 3, 4, 4, 1, 2, 2, 3, 4, 4, 5, 6, 6, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5
OFFSET
1,5
COMMENTS
T(n,1) = 1; T(n,n) = phi(n), where phi is Euler's totient function (A000010); for p prime: T(p,i) = i for 1 <= i < p and T(p,p) = p-1.
LINKS
Eric Weisstein's World of Mathematics, Sieve of Eratosthenes.
Eric Weisstein's World of Mathematics, Legendre's Formula.
FORMULA
T(n,k) = Sum_{mu(d)*floor(k/d): n mod d = 0}, where mu is the Moebius Function (A008683).
EXAMPLE
Triangle begins
1;
1, 1;
1, 2, 2;
1, 1, 2, 2;
1, 2, 3, 4, 4;
1, 1, 1, 1, 2, 2;
1, 2, 3, 4, 5, 6, 6;
1, 1, 2, 2, 3, 3, 4, 4;
1, 2, 2, 3, 4, 4, 5, 6, 6;
1, 1, 2, 2, 2, 2, 3, 3, 4, 4;
...
MAPLE
A078401 := proc(n, k)
a := 0 ;
for j from 1 to k do
if igcd(j, n) = 1 then
a := a+1 ;
end if;
end do:
a ;
end proc: # R. J. Mathar, Jul 21 2016
MATHEMATICA
T[n_, k_] := Count[Range[k], d_ /; CoprimeQ[n, d]];
Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Feb 13 2018 *)
CROSSREFS
Sequence in context: A298231 A320473 A194884 * A372673 A271381 A086247
KEYWORD
nonn,tabl,easy
AUTHOR
Reinhard Zumkeller, Dec 25 2002
EXTENSIONS
Thanks to Duc Ngo Minh (ducnm0(AT)gmail.com), who noticed an error in the formula; corrected by Reinhard Zumkeller, Mar 01 2009
STATUS
approved