|
|
A134451
|
|
Ternary digital root of n.
|
|
22
|
|
|
0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Minimum number of terms required to express n as a sum of odd numbers.
For n > 0, a(n) is the minimal gap of distinct numbers coprime to n. Proof: denote the minimal gap by b(n). For odd n we have A058026(n) > 0, hence b(n) = 1. For even n, since 1 and -1 are both coprime to n we have b(n) <= 2, and that b(n) >= 2 is obvious.
The maximal gap is given by A048669. (End)
|
|
LINKS
|
Eric Weisstein's World of Mathematics, Ternary.
|
|
FORMULA
|
a(n) = n if n <= 2, otherwise a(A053735(n)).
a(n) = 0 if n=0, otherwise A000034(n-1).
Multiplicative with a(2^e) = 2, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Aug 06 2018
Dirichlet g.f.: zeta(s)*(1+1/2^s). - Amiram Eldar, Jan 01 2023
|
|
EXAMPLE
|
0.732050807568877293527446341... = 0 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))). - Harry J. Smith, May 31 2009
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[Mod[n + 1, 2] + 2 Sign[n] - 1, {n, 0, 100}] (* Wesley Ivan Hurt, Dec 06 2013 *)
|
|
PROG
|
(PARI) { allocatemem(932245000); default(realprecision, 12000); x=contfrac(sqrt(3)-1); for (n=0, 20000, write("b134451.txt", n, " ", x[n+1])); } [Harry J. Smith, May 31 2009]
(Haskell)
a134451 = until (< 3) a053735
|
|
CROSSREFS
|
Apart from a(0) the same as A040001.
Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1).
|
|
KEYWORD
|
nonn,base,easy,mult
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|