OFFSET
1,2
COMMENTS
Empirical observations: this sequence is extremely slow to grow, but I believe it diverges; the mode M(n) grows slowly and after some initial stabilization increases in intervals of 2; the distribution of even numbers in the limit follows a Gaussian distribution, and the distribution of odd numbers in the limits follows its *own* smaller Gaussian distribution.
The graph of the first 100000 terms looks somewhat like that 90's Jazz design that was on cups and other items, with a darker band concentrated in the middle of thick, diffuse swooshes.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
Wikipedia, Jazz (design).
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Jarrod G. Sage, Sep 15 2023
STATUS
approved