login
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

%I #37 Mar 31 2024 19:04:59

%S 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,

%T 12,14,14,16,16,18,15,14,18,17,20,10,14,20,12,16,20,14,13,12,18,19,13,

%U 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

%N 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.

%C 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.

%C 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.

%H John Tyler Rascoe, <a href="/A364935/b364935.txt">Table of n, a(n) for n = 1..10000</a>

%H Wikipedia, <a href="https://en.m.wikipedia.org/wiki/Jazz_(design)">Jazz (design)</a>.

%e 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.

%e 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.

%e For n=4, 17 -> 2178 -> 18, a(4) = 18.

%o (Python)

%o from collections import Counter

%o def A364935_list(max_n):

%o A, C = [1], Counter()

%o for n in range(2,max_n+1):

%o x = str(A[n-2])

%o C.update({x})

%o z = str(int(x[0])+C[x]) + x + str(int(x[-1])+C[x])

%o A.append(sum(int(z[i]) for i in range (0,len(z))))

%o return(A) # _John Tyler Rascoe_, Oct 22 2023

%K base,easy,look,nonn

%O 1,2

%A _Jarrod G. Sage_, Sep 15 2023