A303536 Number of terms in greedy partition of n into binary palindromes.
0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1
Offset: 0
Examples
For n = 44: The largest palindrome not exceeding 44 is 33 (100001). 44 - 33 = 11. The largest palindrome not exceeding 11 is 9 (1001). 11 - 9 = 2. The largest palindrome not exceeding 2 is 1. 2 - 1 = 1. The largest palindrome not exceeding 1 is 1. 1 - 1 = 0. The iteration took 4 steps to reach 0, so a(44) = 4. For n = 131630; A303534(131630) = 557 and A303534(557) = 44. Since a(44) = 4 (as above), a(557) = 5 and a(131630) = 6. - _Altug Alkan_, Apr 26 2018
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
- Javier Cilleruelo and Florian Luca, Every Positive Integer is a Sum of Three Palindromes.
- Index entries for sequences related to binary expansion of n
Programs
Formula
a(0) = 0; for n > 0, a(n) = 1 + a(A303534(n)). [We are iterating the map n -> A303534(n) until zero is reached.] - Antti Karttunen, May 13 2018, after an earlier comment.
Extensions
More terms from Altug Alkan, Apr 25 2018
Comments