A373096 a(n) = a([n/9]) + a([n/27]) + a([n/81]) + ..., where a(0) = 0, a(1) = 1, and [ ] = floor().
0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2
Offset: 0
Keywords
Programs
-
Maple
A373096 := proc(n) option remember; if n <=1 then n; else add( procname(floor(n/3^k)),k=2..n) ; end if; end proc: seq(A373096(n),n=0..100) ; # R. J. Mathar, Jun 07 2024
-
Mathematica
a[0] = 0; a[1] = 1; a[n_] := a[n] = Sum[a[Floor[n/3^k]], {k, 2, n}] Table[a[n], {n, 0, 570}]
-
PARI
a(n) = if (n<=1, n, sum(k=2, n, a(n\3^k))); \\ Michel Marcus, Jun 01 2024
Formula
Following the first 3^2 terms (all zeros and ones): 3^2 ones, 3^2 zeros, 3^3 ones, 3^3 zeros, 3^4 twos, 3^4 zeros, 3^5 threes, 3^5 zeros, 3^6 fives, 3^6 zeros, etc.
Comments