A115070 a(n) = phi(n)/3^b(n), where b(n) is #{primes p=1 mod 3 dividing n}.
1, 1, 2, 2, 4, 2, 2, 4, 6, 4, 10, 4, 4, 2, 8, 8, 16, 6, 6, 8, 4, 10, 22, 8, 20, 4, 18, 4, 28, 8, 10, 16, 20, 16, 8, 12, 12, 6, 8, 16, 40, 4, 14, 20, 24, 22, 46, 16, 14, 20, 32, 8, 52, 18, 40, 8, 12, 28, 58, 16, 20, 10, 12, 32, 16, 20, 22, 32, 44, 8, 70, 24, 24, 12, 40, 12, 20, 8, 26, 32, 54
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
- Steven R. Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
Programs
-
Maple
with(numtheory): a:= n-> phi(n)/3^add(`if`(irem(p, 3)=1, 1, 0), p=factorset(n)): seq(a(n), n=1..100); # Alois P. Heinz, Feb 17 2019
-
Mathematica
b[n_] := Count[FactorInteger[n][[All, 1]], p_ /; Mod[p, 3] == 1]; b[1] = 0; a[n_] := EulerPhi[n]/3^b[n]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Feb 17 2019 *) f[p_, e_] := (p - 1)*p^(e - 1)/If[Mod[p, 3] == 1, 3, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 30 2024 *)
-
PARI
{b(n)=my(f=factor(n)[, 1]); sum(i=1, #f, f[i]%3==1)}; {a(n)= eulerphi(n)/3^b(n)}; vector(80, n, a(n)) \\ G. C. Greubel, Feb 17 2019
-
PARI
a(n) = {my(f = factor(n)); prod(i = 1, #f~, (f[i,1]-1)*f[i,1]^(f[i,2]-1)/if(f[i,1] % 3 == 1, 3,1));} \\ Amiram Eldar, Nov 30 2024
Formula
From Amiram Eldar, Nov 30 2024: (Start)
Multiplicative with a(p^e) = (p-1)*p^(e-1)/3 if p == 1 (mod 3), and (p-1)*p^(e-1) otherwise. (End)
Extensions
a(1)=1 prepended by Alois P. Heinz, Feb 17 2019
Keyword mult added by Amiram Eldar, Nov 30 2024
Comments