|
Search: id:A065361
|
|
|
| A065361 |
|
Rebase n from 3 to 2. Replace 3^k with 2^k in ternary expansion of n. |
|
+0 10
|
|
| 0, 1, 2, 2, 3, 4, 4, 5, 6, 4, 5, 6, 6, 7, 8, 8, 9, 10, 8, 9, 10, 10, 11, 12, 12, 13, 14, 8, 9, 10, 10, 11, 12, 12, 13, 14, 12, 13, 14, 14, 15, 16, 16, 17, 18, 16, 17, 18, 18, 19, 20, 20, 21, 22, 16, 17, 18, 18, 19, 20, 20, 21, 22, 20, 21, 22, 22, 23, 24, 24, 25, 26, 24, 25, 26, 26, 27
(list; graph; listen)
|
|
|
OFFSET
|
0,3
|
|
|
COMMENT
|
Notation: (3)[n](2)
|
|
LINKS
|
Harry J. Smith, Table of n, a(n) for n=0,...,1000
|
|
FORMULA
|
a(0)=0, a(3n)=2*a(n), a(3n+1)=2*a(n)+1, a(3n+2)=2*a(n)+2. - Benoit Cloitre (benoit7848c(AT)orange.fr), Dec 21 2002
a(n)=2*a(floor(n/3))+n-3*floor(n/3) - Benoit Cloitre (benoit7848c(AT)orange.fr), Apr 27 2003
|
|
EXAMPLE
|
15 = 120 -> 1(4)+2(2)+0(1) = 8 = a(15)
|
|
PROGRAM
|
(PARI) a(n)=if(n<1, 0, if(n%3, a(n-1)+1, 2*a(n/3)))
(PARI) a(n)=if(n<1, 0, 2*a(floor(n/3))+n-3*floor(n/3))
(PARI) Rebase(x, b, c)= { local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=c); return(e) } { for (n=0, 1000, write("b065361.txt", n, " ", Rebase(n, 3, 2)) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Oct 17 2009]
|
|
CROSSREFS
|
Cf. A065362
Sequence in context: A096607 A103416 A029091 this_sequence A089792 A081608 A096532
Adjacent sequences: A065358 A065359 A065360 this_sequence A065362 A065363 A065364
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
Marc LeBrun (mlb(AT)well.com), Oct 31 2001
|
|
|
Search completed in 0.002 seconds
|