The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A105672 a(1)=1, then bracketing n with powers of 3 as f(t)=3^t for f(t) < n <= f(t+1), a(n) = f(t+1) - a(n-f(t)). 5
 1, 2, 1, 8, 7, 8, 1, 2, 1, 26, 25, 26, 19, 20, 19, 26, 25, 26, 1, 2, 1, 8, 7, 8, 1, 2, 1, 80, 79, 80, 73, 74, 73, 80, 79, 80, 55, 56, 55, 62, 61, 62, 55, 56, 55, 80, 79, 80, 73, 74, 73, 80, 79, 80, 1, 2, 1, 8, 7, 8, 1, 2, 1, 26, 25, 26, 19, 20, 19, 26, 25, 26, 1, 2, 1, 8, 7, 8, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS FORMULA a(n+1) = 1 + Sum_{k=1..n} (-1)^k*(2-3*3^valuation(k, 3)). a(n) = A064235(n) - a(n - A064235(n)/3). - R. J. Mathar, Nov 06 2011 MAPLE A105672 := proc(n)         option remember;         if n = 1 then                 1;         else                 fn1 := A064235(n) ;                 fn := fn1/3 ;                 fn1-procname(n-fn) ;         end if; end proc: seq(A105672(n), n=1..80) ; # R. J. Mathar, Nov 06 2011 MATHEMATICA A064235[n_] := 3^Ceiling[Log[3, n]]; a[1] = 1; a[n_] := a[n] = A064235[n] - a[n - A064235[n]/3]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Jul 09 2013, after R. J. Mathar *) PROG (PARI) b(n, m)=if(n<2, 1, m*m^floor(log(n-1)/log(m))-b(n-m^floor(log(n-1)/log(m)), m)) CROSSREFS Cf. A105669, A105670, A093347, A093348. Sequence in context: A254180 A248052 A340629 * A338249 A214271 A262007 Adjacent sequences:  A105669 A105670 A105671 * A105673 A105674 A105675 KEYWORD nonn AUTHOR Benoit Cloitre, May 03 2005 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 15 07:17 EDT 2021. Contains 343909 sequences. (Running on oeis4.)