A129139 a(n) = number of positive integers which are coprime to n and are <= d(n), where d(n) = A000005(n).
1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 3, 2, 4, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 3, 3, 2, 3, 3, 2, 3, 4, 3, 3, 2, 2, 3, 2, 2, 4, 4, 4, 3, 2, 3, 3, 2, 2, 4, 2, 2, 3, 3, 4, 3, 2, 4, 4, 2, 2, 3, 4, 2, 3, 4, 2, 3, 4, 3, 3, 2, 4, 4, 2, 3, 4, 4, 2, 3, 2, 4, 4
Offset: 1
Keywords
Examples
d(16) = 5. So a(16) is the number of integers coprime to 16 which are <= 5. There are 3 such integers: 1, 3, 5; so a(16) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Programs
-
Maple
with(numtheory): a:=proc(n) local ct,j: ct:=0: for j from 1 to tau(n) do if gcd(j,n)=1 then ct:=ct+1 else fi od: ct; end: seq(a(n),n=1..140); # Emeric Deutsch, Apr 02 2007
-
Mathematica
A129139[n_] := Count[CoprimeQ[Range[DivisorSigma[0, n]], n], True]; Array[A129139, 100] (* Paolo Xausa, Mar 27 2025 *)
-
PARI
A129139(n) = sum(k=1,numdiv(n),(1==gcd(k,n))); \\ Antti Karttunen, Apr 01 2021
Formula
a(n) = Sum_{d|n} mu(d)*floor(tau(n)/d). - Ridouane Oudra, Mar 26 2025
Extensions
More terms from Emeric Deutsch, Apr 02 2007