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.

This page as a plain text file.
%I A300828 #16 Apr 07 2025 10:00:12
%S A300828 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,
%T A300828 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,
%U A300828 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
%N A300828 Multiplicative with a(p^2) = 1, a(p^3) = -2 and a(p^e) = 0 when e = 1 or e > 3.
%C A300828 Used for computing A208133.
%H A300828 Antti Karttunen, <a href="/A300828/b300828.txt">Table of n, a(n) for n = 1..65537</a>
%e A300828 For n = 216 = 2^3 * 3^3, a(2^3) * a(3^3) = -2 * -2 = 4.
%t A300828 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 *)
%o A300828 (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
%o A300828 (Scheme)
%o A300828 ;; With memoization-macro definec.
%o A300828 (definec (A300828 n) (if (= 1 n) n (* (case (A067029 n) ((2) 1) ((3) -2) (else 0)) (A300828 (A028234 n)))))
%Y A300828 Cf. A208133.
%K A300828 sign,easy,mult
%O A300828 1,8
%A A300828 _Antti Karttunen_, Mar 21 2018