A093348 A 5-fractal "castle" starting with 0.
0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24, 25, 24, 25, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24
Offset: 1
Keywords
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
- Benoit Cloitre, Graph of a(n) for n=1 up to 25
- Benoit Cloitre, Graph of a(n) for n=1 up to 125
- Benoit Cloitre, Graph of a(n) for n=1 up to 625
Programs
-
Mathematica
a[n_] := Sum[(-1)^(i+1) * 5^IntegerExponent[i, 5], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
-
PARI
a(n)=if(n<2,0,5^floor(log(n-1)/log(5))-a(n-5^floor(log(n-1)/log(5))))
Formula
a(1) = 0, then a(n) = w(n) - a(n-w(n)) where w(n) = 5^floor(log(n-1)/log(5)).
a(n) = Sum_{i=1..n-1} (-1)^(i-1)*5^valuation(i, 5).
Conjecture: a(n+1) = (n mod 2) + Sum_{k=0..infinity} (4*5^k*(floor(n/5^(k+1)) mod 2)). - Charlie Neder, May 25 2019