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.
%I A154271 #46 Jul 16 2025 17:53:23 %S A154271 1,0,-1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0, %T A154271 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,0,0,0,0,0,0,0, %U A154271 0,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 %N A154271 Dirichlet inverse of A154272; Fully multiplicative with a(3^e) = (-1)^e, a(p^e) = 0 for primes p <> 3. %C A154271 Abs(A154272) is a Fredholm-Rueppel-like sequence. %C A154271 Sequence equals +1 if n is an even power of 3 (3^0, 3^2, 3^4,...), equals -1 if n is an odd power of 3 (3^1, 3^3, 3^5, 3^7,...) and zero elsewhere. - Comment edited by _R. J. Mathar_, Jun 24 2013 %H A154271 Antti Karttunen, <a href="/A154271/b154271.txt">Table of n, a(n) for n = 1..59049</a> (terms 1..220 from Mats Granvik) %F A154271 Fully multiplicative with a(3) = -1, a(p) = 0 for primes p <> 3. - _Antti Karttunen_, Jul 24 2017 %F A154271 From _Amiram Eldar_, Nov 03 2023: (Start) %F A154271 abs(a(n)) = A225569(n-1). %F A154271 Dirichlet g.f.: 1/(1+3^(-s)). (End) %F A154271 a(n) = Sum_{d|n} A359377(d)*A008836(n/d). - _Ridouane Oudra_, Jul 15 2025 %t A154271 nn = 95;a = PadRight[{1, 0, 1}, nn, 0];Inverse[Table[Table[If[Mod[n, k] == 0, a[[n/k]], 0], {k, 1, nn}], {n, 1, nn}]][[All, 1]] (* _Mats Granvik_, Jul 24 2017 *) %o A154271 (PARI) A154271(n) = { my(k=valuation(n,3)); if((3^k)==n,(-1)^k,0); }; \\ _Antti Karttunen_, Jul 24 2017 %o A154271 (Scheme) (define (A154271 n) (cond ((= 1 n) 1) ((zero? (modulo n 3)) (* -1 (A154271 (/ n 3)))) (else 0))) ;; _Antti Karttunen_, Jul 24 2017 %Y A154271 Cf. A154272, A154269, A014578 (Möbius inverse), A154282, A225569. %Y A154271 Cf. A225569 (gives the absolute values when interpreted as the characteristic function of powers of 3, i.e., with starting offset 1 instead of 0). %Y A154271 Cf. A359377, A008836. %K A154271 sign,mult,easy %O A154271 1,1 %A A154271 _Mats Granvik_, Jan 06 2009 %E A154271 Alternative description added to the name by _Antti Karttunen_, Jul 24 2017