login
a(n) = largest number k <= A130249(n) for which A372555(n-A001045(k)) = A372555(n)-1, where A372555(n) is the least number of Jacobsthal numbers that add up to n.
3

%I #14 May 10 2024 11:16:39

%S 0,2,2,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,

%T 6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,7,7,7,7,

%U 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8

%N a(n) = largest number k <= A130249(n) for which A372555(n-A001045(k)) = A372555(n)-1, where A372555(n) is the least number of Jacobsthal numbers that add up to n.

%C An auxiliary sequence for computing A372555 with a mutually recursive algorithm.

%C Differs from A130249 for the first time at n=63, 84, 191, 212, 255, etc. See A372558.

%C Conjecture: For all n, either a(n) = A130249(n) or a(n) = A130249(n)-1. In other words, there is always a minimal solution (in number of summands) for representing n as a sum of Jacobsthal numbers that its largest summand is either A001045(A130249(n)) [same as obtained with a greedy algorithm A265745], or the next smaller Jacobsthal number. - _Antti Karttunen_, May 10 2024

%H Antti Karttunen, <a href="/A372556/b372556.txt">Table of n, a(n) for n = 0..87381</a>

%o (PARI)

%o up_to = 87381; \\ = A001045(18).

%o A001045(n) = (2^n - (-1)^n) / 3;

%o A130249(n) = (#binary(3*n+1)-1);

%o A372555_or_556list(up_to_n,return_556_instead) = { my(v372555 = vector(up_to_n), v372556 = vector(up_to_n)); v372555[1] = 1; v372556[1] = 2; for(n=2,#v372556, my(m=-1,mk=-1,s=A130249(n)); if(A001045(s)==n, v372555[n] = 1; v372556[n] = s, forstep(k=s, 1, -1, my(c=v372555[n-A001045(k)]); if(m<0 || c<m, m=c; mk=k)); v372556[n] = mk; v372555[n] = 1+v372555[n-A001045(mk)])); if(return_556_instead,v372556,v372555); };

%o v372556 = A372555_or_556list(up_to,1);

%o A372556(n) = if(!n,n,v372556[n]);

%o (Scheme) ;; Use the program given in A372555.

%Y Cf. A001045, A130249, A147612, A372556, A372558.

%K nonn

%O 0,2

%A _Antti Karttunen_, May 07 2024