login
This site is supported by donations 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; internal format)
OFFSET

1,2

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

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: A060587 A168142 A081800 * A005489 A015152 A021461

Adjacent sequences:  A105669 A105670 A105671 * A105673 A105674 A105675

KEYWORD

nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), May 03 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 21:13 EST 2012. Contains 206085 sequences.