|
|
A093349
|
|
A 7-fractal "castle" starting with 0.
|
|
4
|
|
|
0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 49, 48, 49, 48, 49, 48, 49, 42, 43, 42, 43, 42, 43, 42, 49, 48, 49, 48, 49, 48, 49, 42, 43, 42, 43, 42, 43, 42, 49, 48, 49, 48, 49, 48, 49, 42, 43
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,8
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 0 then a(n) = w(n) - a(n-w(n)) where w(n) = 7^floor(log(n-1)/log(7)).
a(n) = Sum_{i=1..n-1} (-1)^(i-1)*7^valuation(i, 7).
|
|
MATHEMATICA
|
a[n_] := Sum[(-1)^(i+1) * 7^IntegerExponent[i, 7], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
|
|
PROG
|
(PARI) a(n)=if(n<2, 0, 7^floor(log(n-1)/log(7))-a(n-7^floor(log(n-1)/log(7))))
(PARI) a(n)=-sum(i=1, n-1, (-1)^i*7^valuation(i, 7))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|