A290251 a(n) is the number of parts in the integer partition having viabin number n.
0, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4
Offset: 0
Examples
a(9) = 3. Indeed, the binary form of 9 is 1001; with an additional 0 at the end, it leads to the path ENNEN, where E=(1,0), N=(0,1); this path is the southeast border of the Ferrers board of the integer partition [2,1,1], having 3 parts. From _Omar E. Pol_, Jul 24 2017: (Start) Written as an irregular triangle the sequence begins: 0; 1; 2,1; 3,2,2,1; 4,3,3,2,3,2,2,1; 5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1; 6,5,5,4,5,4,4,3,5,4,4,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1; ...(End)
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
Crossrefs
Programs
-
Maple
a := proc (n) if n < 2 then n elif `mod`(n, 2) = 0 then 1+a((1/2)*n) else a((1/2)*n-1/2) end if end proc: seq(a(n), n = 0 .. 150);
-
Mathematica
a[n_] := a[n] = Which[n < 2, n, EvenQ[n], 1+a[n/2], True, a[(n-1)/2]]; Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Aug 06 2024 *)
-
PARI
A290251(n) = ((n>0)+#binary(n)-hammingweight(n)); \\ Antti Karttunen, Oct 06 2023
Formula
Extensions
Data section extended up to n=105 by Antti Karttunen, Oct 06 2023
Comments