This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A356988 #25 Oct 26 2022 07:59:05 %S A356988 1,1,2,3,3,4,5,5,6,7,8,8,8,9,10,11,12,13,13,13,13,14,15,16,17,18,19, %T A356988 20,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,34,34,34, %U A356988 34,34,34,34,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,55,55,55,55,55 %N A356988 a(n) = n - a^[2](n - a^[3](n-1)) with a(1) = 1, where a^[2](n) = a(a(n)) and a^[3](n) = a(a(a(n))). %C A356988 This is the second sequence in a family of nested-recurrent sequences with apparently similar structure defined as follows. Given a sequence s = {s(n) : n >= 1} we define the k-th iterated sequence s^[k] by putting s^[1](n) = s(n) and setting s^[k](n) = s^[k-1](s(n)) for k >= 2. For k >= 1, we define a nested-recurrent sequence, dependent on k, by putting u(1) = 1 and setting u(n) = n - u^[k](n - u^[k+1](n-1)) for n >= 2. This is the case k = 2. For other cases see A006165 (k = 1), A356989 (k = 3) and A356990 (k = 4). %C A356988 The sequence is slow, that is, for n >= 1, a(n+1) - a(n) is either 0 or 1. The sequence is unbounded. %C A356988 The line graph of the sequence {a(n)} thus consists of a series of plateaus (where the value of the ordinate a(n) remains constant as n increases) joined by lines of slope 1. %C A356988 The sequence of plateau heights begins 3, 5, 8, 13, 21, 34, 55, ..., the Fibonacci numbers A000045. %C A356988 The plateaus start at abscissa values n = 4, 7, 11, 18, 29, 47, 76, ..., the Lucas numbers A000032, and finish at abscissa values n = 5, 8, 13, 21, 34, 55, 89, ..., the Fibonacci numbers. The sequence of plateau lengths 1, 1, 2, 3, 5, 8, 13, ... is thus the Fibonacci sequence. %C A356988 The iterated sequences{a^[k](n) : n >= 1}, k = 2, 3,..., share similar properties to the present sequence. See the Example section below. %H A356988 Peter Bala, <a href="/A356988/a356988.pdf">Notes on A356988</a> %F A356988 a(n+1) - a(n) = 0 or 1. %F A356988 The terms of the sequence are completely determined by the following two results: %F A356988 a) for n >= 2, a(L(n-1) + j) = F(n) for 0 <= j <= F(n-3), where F(n) = A000045(n), the n-th Fibonacci number with F(-1) = 1 and L(n) = A000032(n), the n-th Lucas number; %F A356988 b) for n >= 2, a(F(n+1) + j) = F(n) + j for 0 <= j <= F(n-1). %F A356988 Hence a(F(n+2)) = a(F(n+1)) + a(F(n)) for n >= 2 and a(L(n+2)) = a(L(n+1)) + a(L(n)) for n >= 0. %F A356988 a(2*F(n)) = Lucas(n-1) for n >= 2; %F A356988 a(3*F(n)) = 2*F(n) for n >= 1; %F A356988 a(4*F(n)) = F(n+2) for n >= 2; %F A356988 a(5*F(n)) = 4*F(n) - F(n-1) = A022120(n-2) for n >= 2. %F A356988 a(2*L(n)) = F(n) + 3*F(n-1) = A104449(n) for n >= 0; %F A356988 a(3*L(n)) = F(n+3) for n >= 3; %F A356988 a(4*L(n)) = F(n+4) - L(n-3) = A022114(n-1) for n >= 3; %F A356988 a(5*L(n)) = 11*F(n-1) + F(n-4) = A022367(n-1) for n >= 4. %F A356988 For n >= 1, m >= 2, a(F(m*n)) = F(m*n-1) and a(L(m*n)) = F(m*n+1). Hence %F A356988 a(L(m*n)) + a(F(m*n)) = L(m*n) and a(L(m*n)) - a(F(m*n)) = F(m*n). %F A356988 Conjectures: %F A356988 1) a(n) + a^[2](n - a^[2](n - a^[2](n))) = n for n >= 2. %F A356988 2) If k >= 2 and m = 2*k - 1 then a(m*n - a(k*n)) = a(m*n - a(m*n - a(m*n - a(k*n)))). %e A356988 Related sequences: %e A356988 1) The square of the sequence: {a^[2](n) : n >= 1} = {a(a(n)) : n >= 1}. The first few terms are %e A356988 1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 36, 37, 38, 39, ... %e A356988 The sequence is slow. The line graph of the sequence has plateaus of height Fibonacci(k), k >= 2, starting at abscissa value 2*Fibonacci(k) and ending at abscissa Fibonacci(k+2). %e A356988 2) The cube of the sequence: {a^[3](n) : n >= 1} = {a(a(a(n))) : n >= 1}. The first few terms are %e A356988 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, ... %e A356988 The line graph of the sequence has plateaus of height Fibonacci(k), k >= 2, starting at abscissa value 3*Fibonacci(k) and ending at abscissa Fibonacci(k+3). %p A356988 a := proc(n) option remember; if n = 1 then 1 else n - a(a(n - a(a(a(n-1))))) end if; end proc: %p A356988 seq(a(n), n = 1..100); %Y A356988 Cf. A000032, A000045, A001611, A006165, A022114, A022120, A022367, A104449, A356989, A356990, A356991 - A356999. %K A356988 nonn,easy %O A356988 1,3 %A A356988 _Peter Bala_, Sep 08 2022