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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A001221, A005091, A005094, A083025 (with multiplicity).

Programs

  • Haskell
    a005089 = sum . map a079260 . a027748_row
    -- Reinhard Zumkeller, Jan 07 2013
    
  • Magma
    [#[p:p in PrimeDivisors(n)|p mod 4 eq 1]: n in [1..100]]; // Marius A. Burtea, Jan 16 2020
  • Maple
    A005089 := proc(n)
        local a,pe;
        a := 0 ;
        for pe in ifactors(n)[2] do
            if modp(op(1,pe),4) =1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end  proc:
    seq(A005089(n),n=1..100) ; # R. J. Mathar, Jul 22 2021
  • Mathematica
    f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==1&]; Table[f[n],{n,102}] (* Ray Chandler, Dec 18 2011 *)
    a[n_] := DivisorSum[n, Boole[PrimeQ[#] && Mod[#, 4] == 1]&]; Array[a, 100] (* Jean-François Alcover, Dec 01 2015 *)
  • PARI
    for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-1)%4,0,1)),","))
    

Formula

Additive with a(p^e) = 1 if p == 1 (mod 4), 0 otherwise.
From Reinhard Zumkeller, Jan 07 2013: (Start)
a(n) = Sum_{k=1..A001221(n)} A079260(A027748(n,k)).
a(A004144(n)) = 0.
a(A009003(n)) > 0. (End)