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.

A339932 a(n+1) = a(n-4-a(n)^2) + 1, starting with a(1) = a(2) = a(3) = a(4) = a(5) = 0.

This page as a plain text file.
%I A339932 #11 Dec 27 2020 19:45:43
%S A339932 0,0,0,0,0,1,1,1,1,1,1,2,1,2,2,2,2,2,2,2,3,2,3,2,3,3,2,3,3,3,3,3,3,3,
%T A339932 4,3,4,3,4,3,3,4,3,4,3,4,4,3,5,3,5,3,5,3,4,5,3,5,4,5
%N A339932 a(n+1) = a(n-4-a(n)^2) + 1, starting with a(1) = a(2) = a(3) = a(4) = a(5) = 0.
%C A339932 To obtain the next term, square the current term and add 4, then count back this number and add 1.
%C A339932 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 A339932 Every positive integer appears in the sequence.
%C A339932 First occurrence of n: 1, 6, 12, 21, 35, 49, 70, 100, 130, 171, 212, 266, 320, 406, 564, 669, 849,...
%C A339932 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-4-f(x)^2)+1) = 0.
%C A339932 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 8.10... (for n^2 = 5*10^8).
%F A339932 a(n) ~ (3*n)^(1/3) (conjectured).
%e A339932 a(6) = a(5-4-a(5)^2)+1 = a(1)+1 = 1.
%e A339932 a(7) = a(6-4-a(6)^2)+1 = a(1)+1 = 1.
%e A339932 a(8) = a(7-4-a(7)^2)+1 = a(2)+1 = 1.
%e A339932 a(9) = a(8-4-a(8)^2)+1 = a(3)+1 = 1.
%e A339932 a(10) = a(9-4-a(9)^2)+1 = a(4)+1 = 1.
%e A339932 a(11) = a(10-4-a(10)^2)+1 = a(5)+1 = 1.
%e A339932 a(12) = a(11-4-a(11)^2)+1 = a(6)+1 = 2.
%o A339932 (Python)
%o A339932 a = [0, 0, 0, 0, 0]
%o A339932 for n in range(4, 1000):
%o A339932     a.append(a[n-4-a[n]**2]+1)
%o A339932 (C)
%o A339932 #include<stdio.h>
%o A339932 #include<stdlib.h>
%o A339932 int main(void){
%o A339932     int N = 1000;
%o A339932     int *a = (int*)malloc(N*sizeof(int));
%o A339932     a[0] = 0;
%o A339932     a[1] = 0;
%o A339932     a[2] = 0;
%o A339932     a[3] = 0;
%o A339932     a[4] = 0;
%o A339932     for(int n = 4; n < N-1; ++n){
%o A339932         a[n+1] = a[n-4-a[n]*a[n]]+1;
%o A339932     }
%o A339932     free(a);
%o A339932     return 0;
%o A339932 }
%Y A339932 Analogous sequences: A339929, A339930, A339931.
%Y A339932 Cf. A330772, A005206, A002516, A062039.
%K A339932 nonn
%O A339932 1,12
%A A339932 _Rok Cestnik_, Dec 23 2020