login
A160417
a(n) = A160415(n+1)/4.
5
2, 1, 7, 1, 7, 3, 21, 1, 7, 3, 21, 3, 21, 9, 63, 1, 7, 3, 21, 3, 21, 9, 63, 3, 21, 9, 63, 9, 63, 27, 189, 1, 7, 3, 21, 3, 21, 9, 63, 3, 21, 9, 63, 9, 63, 27, 189, 3, 21, 9, 63, 9, 63, 27, 189, 9, 63, 27, 189, 27, 189, 81, 567, 1, 7, 3, 21, 3, 21, 9, 63, 3, 21
OFFSET
1,1
MATHEMATICA
With[{d = 2}, wt[n_] := DigitCount[n, 2, 1]; f[n_] := If[OddQ[n], 3^d + (2^d) * Sum[(2^d - 1)^(wt[k] - 1), {k, 1, (n - 1)/2}] + (2^d)*(3^d - 2) * Sum[(2^d - 1)^(wt[k] - 1), {k, 1, (n - 3)/2}], 3^d + (2^d) * Sum[(2^d - 1)^(wt[k] - 1), {k, 1, n/2 - 1}] + (2^d)*(3^d - 2) * Sum[(2^d - 1)^(wt[k] - 1), {k, 1, n/2 - 1}]]; f[0] = 0; f[1] = 1; Differences[Array[f, 100]]/4] (* Amiram Eldar, Feb 02 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Jun 13 2009
EXTENSIONS
More terms from Max Alekseyev, Dec 12 2011
More terms from Amiram Eldar, Feb 02 2024
STATUS
approved