cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A005089 #32 Jan 27 2025 04:55:18
%S A005089 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 A005089 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 A005089 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 A005089 Number of distinct primes == 1 (mod 4) dividing n.
%H A005089 Reinhard Zumkeller, <a href="/A005089/b005089.txt">Table of n, a(n) for n = 1..10000</a>
%H A005089 É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 A005089 Additive with a(p^e) = 1 if p == 1 (mod 4), 0 otherwise.
%F A005089 From _Reinhard Zumkeller_, Jan 07 2013: (Start)
%F A005089 a(n) = Sum_{k=1..A001221(n)} A079260(A027748(n,k)).
%F A005089 a(A004144(n)) = 0.
%F A005089 a(A009003(n)) > 0. (End)
%p A005089 A005089 := proc(n)
%p A005089     local a,pe;
%p A005089     a := 0 ;
%p A005089     for pe in ifactors(n)[2] do
%p A005089         if modp(op(1,pe),4) =1 then
%p A005089             a := a+1 ;
%p A005089         end if;
%p A005089     end do:
%p A005089     a ;
%p A005089 end  proc:
%p A005089 seq(A005089(n),n=1..100) ; # _R. J. Mathar_, Jul 22 2021
%t A005089 f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==1&]; Table[f[n],{n,102}] (* _Ray Chandler_, Dec 18 2011 *)
%t A005089 a[n_] := DivisorSum[n, Boole[PrimeQ[#] && Mod[#, 4] == 1]&]; Array[a, 100] (* _Jean-François Alcover_, Dec 01 2015 *)
%o A005089 (PARI) for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-1)%4,0,1)),","))
%o A005089 (Haskell)
%o A005089 a005089 = sum . map a079260 . a027748_row
%o A005089 -- _Reinhard Zumkeller_, Jan 07 2013
%o A005089 (Magma) [#[p:p in PrimeDivisors(n)|p mod 4 eq 1]: n in [1..100]]; // _Marius A. Burtea_, Jan 16 2020
%Y A005089 Cf. A001221, A005091, A005094, A083025 (with multiplicity).
%Y A005089 Cf. A079260, A027748, A004144, A009003.
%K A005089 nonn
%O A005089 1,65
%A A005089 _N. J. A. Sloane_