A364935 a(1) = 1 and thereafter a(n) = sum of digits of the number from concatenation of a(n-1) on the left with leftmost digit of a(n-1) + k and concatenation on the right with rightmost digit of a(n-1) + k, where k is the number of times a(n-1) has appeared in the sequence.
1, 5, 17, 18, 20, 6, 20, 8, 26, 18, 13, 10, 4, 14, 12, 8, 10, 6, 22, 10, 8, 12, 10, 10, 12, 12, 14, 14, 16, 16, 18, 15, 14, 18, 17, 20, 10, 14, 20, 12, 16, 20, 14, 13, 12, 18, 19, 13, 14, 15, 16, 13, 16, 15, 18, 21, 8, 14, 17, 13, 18, 23, 12, 20, 16, 17, 15, 20, 18, 25, 16, 19, 15, 13
Offset: 1
Examples
For n=2, a(1) = 1 and "1" has appeared once (k=1) in the sequence. We add 1 to the leftmost digit, 1, and the rightmost digit, 1, and concatenate on each side so 212 which has sum of digits a(2) = 5. For n=3, similarly a(2)=5 has appeared once (1) so we add 1 to the leftmost digit, 5, and the rightmost digit, 5, so 656 and its sum of digits is a(3) = 17. For n=4, 17 -> 2178 -> 18, a(4) = 18.
Links
- John Tyler Rascoe, Table of n, a(n) for n = 1..10000
- Wikipedia, Jazz (design).
Programs
-
Python
from collections import Counter def A364935_list(max_n): A, C = [1], Counter() for n in range(2,max_n+1): x = str(A[n-2]) C.update({x}) z = str(int(x[0])+C[x]) + x + str(int(x[-1])+C[x]) A.append(sum(int(z[i]) for i in range (0,len(z)))) return(A) # John Tyler Rascoe, Oct 22 2023
Comments