A115069 a(n) = 3^b(n), where b(n) is #{primes p=1 mod 3 dividing n}.
1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 3, 1, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 9, 1, 3, 1, 3, 1, 3, 3, 1
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- Steven Finch and Pascal Sebah, Squares and Cubes Modulo n, arXiv:math/0604465 [math.NT], 2006-2016.
Programs
-
Maple
a:= n-> 3^add(`if`(irem(i[1], 3)=1, 1, 0), i=ifactors(n)[2](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]; a[1] = 1; a[n_] := 3^b[n]; Table[a[n], {n, 1, 99}] (* Jean-François Alcover, Feb 17 2019 *)
-
PARI
a(n) = 3^#select(x -> x%3 == 1, factor(n)[,1]); \\ Amiram Eldar, Nov 30 2024
Formula
a(n) = 3^A005088(n). - R. J. Mathar, May 19 2020
From Amiram Eldar, Nov 30 2024: (Start)
Multiplicative with a(p^e) = 3 if p == 1 (mod 3), and 1 otherwise.
Sum_{k=1..n} a(k) ~ (sqrt(3)/(2*Pi)) * c * n * log(n), where c = Product_{primes p == 1 (mod 3)} (1 - 2/(p*(p+1))) = 0.9410349413195354517900322... (Finch and Sebah, 2006). (End)
Extensions
a(1)=1 prepended by Alois P. Heinz, Feb 17 2019
Keyword mult added by Amiram Eldar, Nov 30 2024