login
Number of distinct primes == 1 (mod 4) dividing n.
10

%I #30 Sep 08 2022 08:44:33

%S 0,0,0,0,1,0,0,0,0,1,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,1,0,0,1,1,0,0,0,1,

%T 1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0,0,2,0,0,1,

%U 0,1,0,0,1,1,1,0,0,1,0,1,0,1,0,0,2,0,1,0,1,1,1,0,0,0,1,0,1,0,0,1,1,1

%N Number of distinct primes == 1 (mod 4) dividing n.

%H Reinhard Zumkeller, <a href="/A005089/b005089.txt">Table of n, a(n) for n = 1..10000</a>

%H Étienne Fouvry and Peter Koymans, <a href="https://arxiv.org/abs/2001.05350">On Dirichlet biquadratic fields</a>, arXiv:2001.05350 [math.NT], 2020.

%F Additive with a(p^e) = 1 if p == 1 (mod 4), 0 otherwise.

%F From _Reinhard Zumkeller_, Jan 07 2013: (Start)

%F a(n) = Sum_{k=1..A001221(n)} A079260(A027748(n,k)).

%F a(A004144(n)) = 0.

%F a(A009003(n)) > 0. (End)

%p A005089 := proc(n)

%p local a,pe;

%p a := 0 ;

%p for pe in ifactors(n)[2] do

%p if modp(op(1,pe),4) =1 then

%p a := a+1 ;

%p end if;

%p end do:

%p a ;

%p end proc:

%p seq(A005089(n),n=1..100) ; # _R. J. Mathar_, Jul 22 2021

%t f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==1&]; Table[f[n],{n,102}] (* _Ray Chandler_, Dec 18 2011 *)

%t a[n_] := DivisorSum[n, Boole[PrimeQ[#] && Mod[#, 4] == 1]&]; Array[a, 100] (* _Jean-François Alcover_, Dec 01 2015 *)

%o (PARI) for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-1)%4,0,1)),","))

%o (Haskell)

%o a005089 = sum . map a079260 . a027748_row

%o -- _Reinhard Zumkeller_, Jan 07 2013

%o (Magma) [#[p:p in PrimeDivisors(n)|p mod 4 eq 1]: n in [1..100]]; // _Marius A. Burtea_, Jan 16 2020

%Y Cf. A001221, A005091, A005094.

%Y Cf. A079260, A027748, A004144, A009003.

%K nonn

%O 1,65

%A _N. J. A. Sloane_