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.

A005090 Number of primes == 2 mod 3 dividing n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, 1 &, And[PrimeQ@ #, Mod[#, 3] == 2] &] &, 120] (* Michael De Vlieger, Jul 11 2017 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, (f[k,1] % 3) == 2); \\ Michel Marcus, Jul 11 2017
    
  • Python
    from sympy import primefactors
    def a(n): return sum(1 for p in primefactors(n) if p%3==2)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 11 2017
  • Scheme
    (define (A005090 n) (if (= 1 n) 0 (+ (A004526 (modulo (A020639 n) 3)) (A005090 (A028234 n))))) ;; Antti Karttunen, Jul 10 2017
    

Formula

Additive with a(p^e) = 1 if p = 2 (mod 3), 0 otherwise.
From Antti Karttunen, Jul 10 2017: (Start)
a(1) = 0; for n > 1, floor((A020639(n) mod 3)/2) + a(A028234(n)).
a(n) = A001221(n) - A005088(n) - A079978(n).
(End)

Extensions

More terms from Antti Karttunen, Jul 10 2017