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.
%I A330545 #72 Feb 24 2020 22:03:31 %S A330545 2,2,3,2,5,4,7,6,9,4,5,0,3,2,5,0,5,4,9,6,7,2,5,0,7,4,5,2,3,0,13,10,15, %T A330545 14,23,22,27,22,25,20,25,24,33,32,35,34,45,34,37,36,39,34,35,26,31,26, %U A330545 31,30,35,32,33,24,37,34,35,32,45,40,49,48,51,46,53,48,53,50,55,48,51,44,53 %N A330545 a(1) = 2; thereafter a(n) = a(n-1) + (-1)^(n + 1)*(prime(n) - prime(n - 1) - 1) (where prime(k) denotes the k-th prime). %C A330545 a(n) is the column of the Boustrophedon triangle in A330339 that contains prime(n). %C A330545 If a(n) = 0 then p = prime(n) is a term of A330339, and n is a term of A330546. %C A330545 Since this has a simple recurrence, it is the key to understanding A330339. However, note that this sequence in turn can be simply expressed in terms of the classic sequence A008347: %C A330545 a(n) = prime(n) + 1 - 2 * A008347(n) if n is even, %C A330545 a(n) = 2 * A008347(n) - prime(n) if n is odd. %C A330545 The sequence that ties all these sequences together is A330547 (q.v.). %C A330545 First negative term is a(146) = -2. %C A330545 Note on the links: The illustrations from Angelini and Trump show all the terms 0,1,2,3,4,... (as in A330339), while those of Havermann, Sloane, and Stevenson just show the primes. %C A330545 The column number mod 4 uniquely determines the residue class of primes mod 4 in that column. If the column number is 0,1,2,3 mod 4 then the primes in that column are 1,3,3,1 respectively (see the "Notes" link). - _N. J. A. Sloane_, Jan 04 2020 %C A330545 For large n, the graphs of A330545 and A330547 are essentially identical. %C A330545 Based on the first 10^12 terms, it appears that lim sup |a(n)| is about n^(2/3). This estimate is based on the plots below by Sloane, Trump (the first plot), Havermann (the first plot), and Stevenson (all three plots). - _N. J. A. Sloane_, Jan 21 2020 %H A330545 N. J. A. Sloane, <a href="/A330545/b330545.txt">Table of n, a(n) for n = 1..20000</a> %H A330545 Eric Angelini, <a href="/A330339/a330339.jpg">Illustration of beginning of the triangle in A330339.</a> %H A330545 Hans Havermann, <a href="/A330545/a330545.png">Plot of 4*10^8 terms of A330545</a>, sampled every 1000 terms, points joined. %H A330545 Hans Havermann, <a href="/A330545/a330545_1.png">More detailed view of terms of A330545 from 290 million to 310 million</a>, sampled every 10 terms, points joined. %H A330545 N. J. A. Sloane, <a href="/A330339/a330339.pdf">Illustration of first 16 rows of A330545.</a> %H A330545 N. J. A. Sloane, <a href="/A330339/a330339.txt">Notes on the sequence of Bostrophedon primes (A330399) and the "ski-run" A330545.</a> %H A330545 N. J. A. Sloane, <a href="/A330339/a330339_1.pdf">State diagram for columns of A330545.</a> %H A330545 Frank Stevenson, <a href="/A330547/a330547.png">Plot of first 10^10 terms of A330547, sampled every 10^5 steps.</a> Havermann's plot of 4*10^8 terms appears at the very start of this plot. %H A330545 Frank Stevenson, <a href="/A330547/a330547_1.png">Plot of first 10^11 terms of A330547, sampled every 10^6 steps.</a> The preceding plot of 10^10 terms can be seen to the left of the blue line. %H A330545 Frank Stevenson, <a href="/A330547/a330547_2.png">Plot of first 10^12 terms of A330547, sampled every 10^7 steps.</a> The preceding plot of 10^11 terms can be seen to the left of the blue line. %H A330545 Walter Trump, <a href="/A330339/a330339.png">An extended picture of the triangle in A330339, showing the first 550 rows, down to the row that starts 3989.</a> [The zeroth column is just to the right of the vertical red line. Note that after a while the rows extend to the left of the red line. The digits are too small to be read.] %H A330545 Walter Trump, <a href="/A330339/a330339_1.png">An extended picture of the triangle in A330339, showing the first 550 rows, down to the row that starts 3989.</a> [Same picture as the previous one, but with 6 red dots added to show the primes in column 0.] %F A330545 G.f.: G(-x)*(x+1)/(x-1), where G(x) = 2*x + 2*x^2 +3*x^3 + 4*x^4 + 7*x^5 + ... is the g.f. for A014692, {prime(n) - (n-1): n >= 1}. %t A330545 A330545[1] := 2; A330545[n_] := A330545[n] = (A330545[n - 1] + (-1)^(n + 1) * (Prime[n] - Prime[n - 1] - 1)); Table[A330545[n], {n, 100}] (* _Alonso del Arte_, Dec 27 2019 *) %Y A330545 Cf. A000040, A008347, A014692, A330339, A330546, A330547. %K A330545 sign,easy %O A330545 1,1 %A A330545 _N. J. A. Sloane_, Dec 17 2019 %E A330545 Keyword nonn changed to sign by _Hans Havermann_, Dec 27 2019