A151917 a(0)=0, a(1)=1; for n>=2, a(n) = (2/3)*(Sum_{i=1..n-1} 3^wt(i)) + 1, where wt() = A000120().
0, 1, 3, 5, 11, 13, 19, 25, 43, 45, 51, 57, 75, 81, 99, 117, 171, 173, 179, 185, 203, 209, 227, 245, 299, 305, 323, 341, 395, 413, 467, 521, 683, 685, 691, 697, 715, 721, 739, 757, 811, 817, 835, 853, 907, 925, 979, 1033, 1195, 1201, 1219
Offset: 0
Examples
n=3: (2/3)*(3^1+3^1+3^2+3^1) + 1 = (2/3)*18 + 1 = 13.
Links
- Michel Marcus, Table of n, a(n) for n = 0..10000
- Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 31.
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
- Index entries for sequences related to cellular automata
Programs
-
Mathematica
Array[(2/3) Sum[3^(Total@ IntegerDigits[i, 2]), {i, # - 1}] + 1 &, 50] (* Michael De Vlieger, Nov 01 2022 *)
-
PARI
a(n) = if (n<2, n, 1 + 2*sum(i=1,n-1, 3^hammingweight(i))/3); \\ Michel Marcus, Feb 22 2015
Formula
a(n) = A151914(n)/4.
a(n) = A079315(2n)/4.
For n>=2, a(n) = 2*A151920(n-2) + 1.
For n>=1, a(n) = (1 + A147562(n))/2. - Omar E. Pol, Mar 13 2011
a(2^k) = A007583(k), if k >= 0. - Omar E. Pol, Feb 22 2015
Comments