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.

A087873 a(n)=a(a(n-1))+a(n-a(n-1)) p(a(n))=n, b(n)=p(p(n-1))+a(n-a(n-1)).

This page as a plain text file.
%I A087873 #23 Jan 01 2024 11:20:28
%S A087873 1,1,6,10,10,27,18,19,22,33,34,35,36,39,40,43,49,65,66,67,68,69,72,73,
%T A087873 74,77,78,81,87,88,91,97,107,129,130,131,132,133,134,137,138,139,140,
%U A087873 143,144,145,148,149,152,158,159,160,163,164,167,173,174,177,183,193
%N A087873 a(n)=a(a(n-1))+a(n-a(n-1)) p(a(n))=n, b(n)=p(p(n-1))+a(n-a(n-1)).
%C A087873 The BASIC program implements a(n) = A188163(A188163(n-1))+a(abs(n-a(n-1))) , which does not work as soon as n=5, because a(5) appears at the left and at the right hand side of the equation. This also differs from the recurrence quoted in the NAME section. Another apparent source of confusion is that a(n) in the NAME is probably meant to read A004001(n). Perhaps (but this is not clear), the b(n) in the NAME was thought to define the current sequence, but a(n) = A188163(A188163(n-1)) + A004001(abs(n-A004001(n-1)) gives a different sequence. - _R. J. Mathar_, May 15 2013
%o A087873 (True BASIC)
%o A087873 70 DIM q0(0 to 4000)
%o A087873 71 let q0(0)=1
%o A087873 80 LET q0(1)=1
%o A087873 90 LET q0(2)=1
%o A087873 91 FOR n = 3 to 4000
%o A087873 92 LET q0(n)=q0(q0(n-1))+q0(n-q0(n-1))
%o A087873 93 NEXT n
%o A087873 100 SET MODE "color"
%o A087873 110 SET WINDOW 0,1024,0,750
%o A087873 302 PRINT" by Roger L. Bagula "
%o A087873 303 DIM p(0 to 4000)
%o A087873 310 FOR x=0 to 4000
%o A087873 311 REM if p(q0(x)) hasn't been used already give p() a value
%o A087873 312 IF p(q0(x))=0 then LET p(q0(x))=x
%o A087873 320 NEXT x
%o A087873 330 DIM q1(0 to 4000)
%o A087873 331 let q1(0)=1
%o A087873 382 LET q1(1)=1
%o A087873 383 LET q1(2)=1
%o A087873 384 FOR n = 3 to 4000
%o A087873 385 LET q1(n)=p(p(n-1))+q1(abs(n-q1(n-1)))
%o A087873 386 NEXT n
%o A087873 387 OPEN #1: name "CM1:CRID_data",create newold, org text
%o A087873 390 FOR x=1 to 200
%o A087873 391 PRINT #1: q1(x);",";
%o A087873 392 PRINT q1(x);
%o A087873 393 NEXT x
%o A087873 394 CLOSE #1
%o A087873 460 END
%Y A087873 Cf. A004001.
%K A087873 nonn,obsc,uned,less
%O A087873 1,3
%A A087873 _Roger L. Bagula_, Oct 11 2003