%I A093347
%S A093347 0,1,0,3,2,3,0,1,0,9,8,9,6,7,6,9,8,9,0,1,0,3,2,3,0,1,0,27,26,27,24,25,
%T A093347 24,27,26,27,18,19,18,21,20,21,18,19,18,27,26,27,24,25,24,27,26,27,0,1,
%U A093347 0,3,2,3,0,1,0,9,8,9,6,7,6,9,8,9,0,1,0,3,2,3,0,1,0,81,80,81,78,79,78,81
%N A093347 A 3-fractal "castle" starting with 0.
%H A093347 B. Cloitre, <a href="http://ns3131.ovh.net/~pi314/temporaires/benoit/
Chateau_trifractal_pour_n_allant_de_1_a_9.JPG">Graph of a(n) for
n=1 up to 9</a>
%H A093347 B. Cloitre, <a href="http://ns3131.ovh.net/~pi314/temporaires/benoit/
Chateau_trifractal_pour_n_allant_de_1_a_27.JPG">Graph of a(n) for
n=1 up to 27</a>
%H A093347 B. Cloitre, <a href="http://ns3131.ovh.net/~pi314/temporaires/benoit/
Chateau_trifractal_pour_n_allant_de_1_a_81.JPG">Graph of a(n) for
n=1 up to 81</a>
%H A093347 B. Cloitre, <a href="http://ns3131.ovh.net/~pi314/temporaires/benoit/
Chateau_trifractal_pour_n_allant_de_1_a_243.JPG">Graph of a(n) for
n=1 up to 243</a>
%F A093347 a(1)=0 then a(n)=w(n)-a(n-w(n)) where w(n)=3^floor(log(n-1)/log(3)).
%F A093347 a(3^n)=0, a(3^n+1)=3^n, a(3^n+2)=3^n-1, a(3^n+3)=3^n etc.
%F A093347 a(n) = sum(i=1, n-1, (-1)^(i-1)*3^valuation(i, 3))
%o A093347 (PARI) a(n)=if(n<2,0,3^floor(log(n-1)/log(3))-a(n-3^floor(log(n-1)/log(3))))
%Y A093347 Cf. A093348, A093349
%Y A093347 Cf. A038500.
%Y A093347 Sequence in context: A016458 A058513 A047160 this_sequence A134676 A103491
A089306
%Y A093347 Adjacent sequences: A093344 A093345 A093346 this_sequence A093348 A093349
A093350
%K A093347 nonn
%O A093347 1,4
%A A093347 Benoit Cloitre (benoit7848c(AT)orange.fr), Apr 26 2004
|