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.

A197881 Number of times n occurs in A197863.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := Switch[e, 1, 0, 2, 2, , 1]; a[1] = 1; a[n] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Aug 28 2023 *)
  • PARI
    a(n)=my(es=factor(n)[,2]~);prod(k=1,#es,if(es[k]==1,0,if(es[k]==2,2,1)))
    
  • Scheme
    (define (A197881 n) (cond ((= 1 n) n) (else (* (case (A067029 n) ((1) 0) ((2) 2) (else 1)) (A197881 (A028234 n)))))) ;; Antti Karttunen, Jul 23 2017

Formula

Multiplicative with a(p^e) = 0 if e = 1, 2 if e = 2, and 1 otherwise.

Extensions

More terms from Antti Karttunen, Jul 23 2017