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.

A363764 a(1)=1, and thereafter, a(n) is the number of terms in the sequence thus far that appear with a frequency not equal to that of a(n-1).

This page as a plain text file.
%I A363764 #57 Jul 25 2023 09:14:59
%S A363764 1,0,0,1,0,2,5,5,4,7,7,5,6,10,10,9,12,12,10,10,16,16,14,18,18,15,20,
%T A363764 20,16,20,18,16,24,26,26,27,28,28,28,24,30,33,33,31,35,35,32,37,37,33,
%U A363764 32,35,31,37,30,39,48,48,40,50,50,41,52,52,42,54,54,43,56,56,44,58,58
%N A363764 a(1)=1, and thereafter, a(n) is the number of terms in the sequence thus far that appear with a frequency not equal to that of a(n-1).
%C A363764 The first time a number appears for the 8th time is a(1491228545) = 953950324. - _Pontus von Brömssen_, Jul 06 2023
%H A363764 Neal Gersh Tolunsky, <a href="/A363764/b363764.txt">Table of n, a(n) for n = 1..10000</a>
%H A363764 Thomas Scheuerle, <a href="/A363764/a363764.png">Scatterplot of a(n)/n for the first 100000 values</a>. It is remarkable that we see extreme values a(n)/n > 0.99 for n = {1, 20957, 22061, 24915, ...}.
%H A363764 Neal Gersh Tolunsky, <a href="/A363764/a363764_1.png">Graph of first 500000 terms</a>
%e A363764 a(8)=5 occurs two times, so a(9) is the number of terms which do not occur two times, which is 4 (there are three 0s and one 2).
%t A363764 a[1] = 1; a[n_] := a[n] = Total[Select[Tally[v = Array[a, n - 1]][[;; , 2]], # != Count[v, a[n - 1]] &]]; Array[a, 100] (* _Amiram Eldar_, Jun 30 2023 *)
%o A363764 (Python)
%o A363764 from itertools import count,islice
%o A363764 from collections import defaultdict
%o A363764 def A363764_gen():
%o A363764     x = 1
%o A363764     freq = defaultdict(int)
%o A363764     freq[x] = f0 = 1
%o A363764     freqfreq = defaultdict(int)
%o A363764     freqfreq[1] = 1
%o A363764     for n in count(1):
%o A363764         yield x
%o A363764         x = n-f0*freqfreq[f0]
%o A363764         freq[x] = f0 = freq[x]+1
%o A363764         if f0 != 1: freqfreq[f0-1] -= 1
%o A363764         freqfreq[f0] += 1
%o A363764 def A363764_list(nmax):
%o A363764     return list(islice(A363764_gen(), nmax)) # _Pontus von Brömssen_, Jul 01 2023 (after an idea by _Kevin Ryde_)
%o A363764 (MATLAB)
%o A363764 function a = A363764( max_n )
%o A363764     s = zeros(1,max_n); a = 1; s(2) = 1;
%o A363764     for n = 2:max_n
%o A363764         a(n) = length(find(s(a+1)~=s(a(n-1)+1)));
%o A363764         s(a(n)+1) = s(a(n)+1)+1;
%o A363764     end
%o A363764 end % _Thomas Scheuerle_, Jun 30 2023
%Y A363764 Cf. A350768, A363301.
%K A363764 nonn
%O A363764 1,6
%A A363764 _Neal Gersh Tolunsky_, Jun 28 2023