A134451 Ternary digital root of n.
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
Offset: 0
Examples
n=42: A007089(42) = '1120', A053735(42) = 1+1+2+0 = 4, A007089(4)='11', A053735(4)=1+1=2: therefore a(42) = 2. 0.732050807568877293527446341... = 0 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))). - _Harry J. Smith_, May 31 2009
Links
- Harry J. Smith, Table of n, a(n) for n = 0..20000
- Lorenz Halbeisen and Norbert Hungerbuehler, Number theoretic aspects of a combinatorial function, Notes on Number Theory and Discrete Mathematics 5(4) (1999), 138-150; see Definition 7 for the shadow transform.
- N. J. A. Sloane, Transforms.
- Eric Weisstein's World of Mathematics, Digital Root.
- Eric Weisstein's World of Mathematics, Ternary.
Crossrefs
Programs
-
Haskell
a134451 = until (< 3) a053735 -- Reinhard Zumkeller, May 12 2011
-
Maple
A134451:=n->((n+1) mod 2)+2*signum(n)-1; seq(A134451(n), n=0..100); # Wesley Ivan Hurt, Dec 06 2013
-
Mathematica
Table[Mod[n + 1, 2] + 2 Sign[n] - 1, {n, 0, 100}] (* Wesley Ivan Hurt, Dec 06 2013 *)
-
PARI
a(n) = if(!n, 0, 2 - n%2) \\ Andrew Howroyd, Dec 08 2024
Formula
a(n) = n if n <= 2, otherwise a(A053735(n)).
a(n) = 0 if n=0, otherwise A000034(n-1).
a(n) = ((n+1) mod 2) + 2*sign(n) - 1. - Wesley Ivan Hurt, Dec 06 2013
Multiplicative with a(2^e) = 2, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Aug 06 2018
a(0) = A055034(1) / A000010(1), a(n) = A000010(n+1) / A055034(n+1), n>1. - Torlach Rush, Oct 29 2019
Dirichlet g.f.: zeta(s)*(1+1/2^s). - Amiram Eldar, Jan 01 2023
Comments