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.

A329985 a(1) = 1 and for n > 0, a(n+1) = a(k) - a(n) where k is the number of terms equal to a(n) among the first n terms.

This page as a plain text file.
%I A329985 #21 Mar 07 2020 11:17:46
%S A329985 1,0,1,-1,2,-1,1,0,0,1,-2,3,-2,2,-2,3,-3,4,-3,3,-2,1,1,-2,4,-4,5,-4,4,
%T A329985 -3,4,-5,6,-5,5,-5,6,-6,7,-6,6,-5,4,-2,1,0,-1,2,-1,0,2,-3,2,0,-1,3,-4,
%U A329985 5,-4,3,-1,0,1,-1,2,-3,5,-6,7,-7,8,-7,7,-6,5,-3
%N A329985 a(1) = 1 and for n > 0, a(n+1) = a(k) - a(n) where k is the number of terms equal to a(n) among the first n terms.
%C A329985 In other words, for n > 0, a(n+1) = a(o(n)) - a(n) where o is the ordinal transform of the sequence.
%C A329985 The sequence has interesting graphical features (see plot in Links section).
%H A329985 Rémy Sigrist, <a href="/A329985/b329985.txt">Table of n, a(n) for n = 1..25000</a>
%H A329985 Rémy Sigrist, <a href="/A329985/a329985.png">Density plot of the first 2^22 terms</a>
%H A329985 N. J. A. Sloane (in collaboration with Scott R. Shannon), <a href="/A331452/a331452.pdf">Art and Sequences</a>, Slides of guest lecture in Math 640, Rutgers Univ., Feb 8, 2020. Mentions this sequence.
%e A329985 The first terms, alongside their ordinal transform, are:
%e A329985   n   a(n)  o(n)
%e A329985   --  ----  ----
%e A329985    1     1     1
%e A329985    2     0     1
%e A329985    3     1     2
%e A329985    4    -1     1
%e A329985    5     2     1
%e A329985    6    -1     2
%e A329985    7     1     3
%e A329985    8     0     2
%e A329985    9     0     3
%e A329985   10     1     4
%t A329985 A={1};For[n=2,n<=76,n++,A=Append[A,Part[A,Count[Table[Part[A,i],{i,1,n-1}],Part[A,n-1]]]-Part[A,n-1]]];A (* _Joshua Oliver_, Nov 26 2019 *)
%t A329985 Nest[Append[#, #[[Count[#, #[[-1]] ] ]] - #[[-1]]] &, {1}, 75] (* _Michael De Vlieger_, Dec 01 2019 *)
%o A329985 (PARI) for (n=1, #(a=vector(76)), print1 (a[n]=if (n==1, 1, a[sum(k=1, n-1, a[k]==a[n-1])]-a[n-1])", "))
%Y A329985 o(n) is A330334.
%Y A329985 See A329981 for similar sequences.
%K A329985 sign,look
%O A329985 1,5
%A A329985 _Rémy Sigrist_, Nov 26 2019