login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
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
Sequence in context: A254180 A248052 A340629 * A338249 A214271 A262007
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 06:44 EDT 2024. Contains 371782 sequences. (Running on oeis4.)