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.

A300828 Multiplicative with a(p^2) = 1, a(p^3) = -2 and a(p^e) = 0 when e = 1 or e > 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2018

Keywords

Comments

Used for computing A208133.

Examples

			For n = 216 = 2^3 * 3^3, a(2^3) * a(3^3) = -2 * -2 = 4.
		

Crossrefs

Cf. A208133.

Programs

  • Mathematica
    f[p_, e_] := Switch[e, 2, 1, 3, -2, , 0]; a[n] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 05 2023 *)
  • PARI
    A300828(n) = { if(1==n, return(1)); my(val=1, v=factor(n), d=matsize(v)[1]); for(i=1,d, if(v[i,2] < 2 || v[i,2] > 3, return(0)); if (v[i,2] == 3, val *= -2)); return(val); }; \\ R. J. Mathar, Antti Karttunen, Mar 21 2018
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A300828 n) (if (= 1 n) n (* (case (A067029 n) ((2) 1) ((3) -2) (else 0)) (A300828 (A028234 n)))))