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.

A005091 Number of distinct primes = 3 mod 4 dividing n.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 2, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 2, 0, 1, 1, 0, 1, 2, 0, 0, 2, 1, 0, 2, 1, 1, 1, 0, 0, 1, 1, 2, 1, 1, 0, 1, 0, 1, 2, 0, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1, 2, 0, 0, 1
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a005091 = sum . map a079261 . a027748_row
    -- Reinhard Zumkeller, Jan 07 2013
    
  • Magma
    [0] cat [#[p:p in PrimeDivisors(n)| p mod 4 eq 3]: n in [2..100]]; // Marius A. Burtea, Nov 19 2019
    
  • Magma
    [0] cat [&+[Binomial(p,3) mod 2:p in PrimeDivisors(n)]:n in [2..100]]; // Marius A. Burtea, Nov 19 2019
    
  • Maple
    with(numtheory): seq(add(binomial(p,3) mod 2, p in factorset(n)), n=1..100); # Ridouane Oudra, Nov 19 2019
  • Mathematica
    f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==3&]; Table[f[n],{n,102}] (* Ray Chandler, Dec 18 2011 *)
  • PARI
    for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-3)%4,0,1)),","))
    
  • Python
    from sympy import primefactors
    def A005091(n): return sum(1 for p in primefactors(n) if p&3==3) # Chai Wah Wu, Jul 07 2024

Formula

Additive with a(p^e) = 1 if p = 3 (mod 4), 0 otherwise.
From Reinhard Zumkeller, Jan 07 2013: (Start)
a(n) = Sum_{k=1..A001221(n)} A079261(A027748(n,k)).
a(A072437(n)) = 0.
a(A187811(n)) > 0. (End)
a(n) = Sum_{p|n} (binomial(p,3) mod 2), where p is a prime. - Ridouane Oudra, Nov 19 2019