cp's OEIS Frontend

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.

A339929 a(n+1) = a(n-1-a(n)^2) + 1, starting with a(1) = a(2) = 0.

This page as a plain text file.
%I A339929 #23 Dec 31 2020 07:32:38
%S A339929 0,0,1,1,1,2,1,2,2,2,2,3,1,3,2,3,3,2,2,4,2,4,2,3,4,3,4,3,3,3,5,2,5,2,
%T A339929 4,3,4,5,4,5,4,4,5,4,5,3,4,4,6,4,6,4,5,5,4,6,3,5,3,7,3,7,4,4,5,5,6,4,
%U A339929 7,3,8,3,8,3,5,7,4,8,2,4,5,5,7,6,5,4,8,5,8,4,9,3,6,7,5
%N A339929 a(n+1) = a(n-1-a(n)^2) + 1, starting with a(1) = a(2) = 0.
%C A339929 To obtain the next term, square the current term and add 1, then count back this number and add 1.
%C A339929 The sequence cannot repeat. Proof: Assume a finite period. Label an arbitrary term in the period x. Because of the back-referencing definition it follows that x-1 has to be in the period, and by the same argument so does x-2 and x-3, x-4, ... until 0. But it is not possible to obtain new 0s since each new term is larger than one already existing term.
%C A339929 Every positive integer appears in the sequence.
%C A339929 First occurrence of n: 1, 3, 6, 12, 20, 31, 49, 60, 71, 91, 129, 163, 214, 265, 303, 354, 516, 594, 792, 915, ...
%C A339929 The sequence appears to grow with the cube root of n, which is expected since f(x) = (3*x)^(1/3) satisfies the definition for large x, i.e., lim_{x->oo} f(x+1)-(f(x-1-f(x)^2)+1) = 0.
%C A339929 The width of the distribution of terms within a range (n^2,n^2+n) appears to be constant for large n and can be defined as: lim_{n->oo} ( 1/n*Sum_{k=n..2n} ( Max_{i=k^2..k^2+k} a(i) - Min_{i=k^2..k^2+k} a(i) ) ) and evaluates to 12.98... (for n^2 = 5*10^8).
%C A339929 Each term is determined by referencing an earlier term. Following the chain of these references we can uniquely trace back every term to one of the two initial zeros, e.g., a(60) -> a(49) -> a(31) -> a(20) -> a(14) -> a(11) -> a(5) -> a(2). These progressions form two trees, with the zeros being at their roots (for visualization see the Links section). The average branching factor B (number of links divided by the number of non-leaf nodes) is numerically evaluated to B = 1.51803... (for n = 10^8). Considering the asymptotic behavior of the sequence a(n) ~ (3*n)^(1/3), we can conclude that the number of links within a range (n,m) is asymptotically equal to m-n and therefore B is the inverse of the proportion of non-leaf terms (B = 1.518... then implies that roughly 34% of all terms never get referenced).
%C A339929 An extended definition can be considered that only requires one initial value: a(0) = -1, and the next terms are obtained via a(n+1) = a(n-1-a(n)*|a(n)|)+1.
%H A339929 Rok Cestnik, <a href="/A339929/b339929.txt">Table of n, a(n) for n = 1..1000</a>
%H A339929 Rok Cestnik, <a href="/A339929/a339929.pdf">Term-referencing tree for 1000 terms</a>
%H A339929 Rok Cestnik, <a href="/A339929/a339929.py.txt">Program for plotting the term-referencing tree</a>
%F A339929 a(n) ~ (3*n)^(1/3) (conjectured).
%e A339929 a(3) = a(2-1-a(2)^2)+1 = a(1)+1 = 1.
%e A339929 a(4) = a(3-1-a(3)^2)+1 = a(1)+1 = 1.
%e A339929 a(5) = a(4-1-a(4)^2)+1 = a(2)+1 = 1.
%e A339929 a(6) = a(5-1-a(5)^2)+1 = a(3)+1 = 2.
%o A339929 (Python)
%o A339929 a = [0,0]
%o A339929 for n in range(1,1000):
%o A339929     a.append(a[n-1-a[n]**2]+1)
%o A339929 (C)
%o A339929 #include<stdio.h>
%o A339929 #include<stdlib.h>
%o A339929 int main(void){
%o A339929     int N = 1000;
%o A339929     int *a = (int*)malloc(N*sizeof(int));
%o A339929     a[0] = 0;
%o A339929     a[1] = 0;
%o A339929     for(int n = 1; n < N-1; ++n){
%o A339929         a[n+1] = a[n-1-a[n]*a[n]]+1;
%o A339929     }
%o A339929     free(a);
%o A339929     return 0;
%o A339929 }
%Y A339929 Analogous sequences: A339930, A339931, A339932.
%Y A339929 Cf. A330772, A005206, A002516, A062039.
%K A339929 nonn
%O A339929 1,6
%A A339929 _Rok Cestnik_, Dec 23 2020