OFFSET
1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Peter Borwein and Michael Coons, Transcendence of the Gaussian Liouville number and relatives, arXiv:0806.1694 [math.NT], 2008.
Michael J. Coons, Some aspects of analytic number theory: parity, transcendence, and multiplicative functions, Ph.D. Thesis, Department of Mathematics, Simon Fraser University, 2009.
Chandler Davis and Donald E. Knuth, Number Representations and Dragon Curves -- I and II, Journal of Recreational Mathematics, volume 3, number 2, April 1970, pages 66-81, and number 3, July 1970, pages 133-149. Reprinted in Donald E. Knuth, Selected Papers on Fun and Games, 2011, pages 571-614. a(n) = d(n) at equation 5.2 and multiplicative at equation 6.3.
Kevin Ryde, Iterations of the Terdragon Curve, see index "turn".
Terence Tao, The Erdős discrepancy problem, arXiv:1509.05363 [math.CO], 2016; see Example 1.4.
FORMULA
a(3*n) = a(n), a(3*n+1) = 1 and a(3*n+2) = -1.
G.f.: Sum_{k>=0} x^(3^k) / (1 + x^(3^k) + x^(2*3^k)).
Sum_{k>=1} a(k)/2^k = A343786.
From Peter Munn, Jun 10 2021: (Start)
a(n) = 1 if n is in A182828, otherwise a(n) = -1.
MATHEMATICA
f[p_, e_] := If[Mod[p, 3] == 2, (-1)^e, 1]; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) a(n) = my(r); until(r, [n, r]=divrem(n, 3)); -(-1)^r; \\ Kevin Ryde, Nov 09 2021
(Python)
from functools import reduce
from operator import ixor
from sympy import factorint
def A343785(n): return -1 if reduce(ixor, (e&1 if p%3==2 else 0 for p, e in factorint(n).items()), 0) else 1 # Chai Wah Wu, Dec 23 2022
CROSSREFS
KEYWORD
sign,mult,easy
AUTHOR
Amiram Eldar, Apr 29 2021
STATUS
approved