OFFSET
1,1
COMMENTS
a(n) is the column of the Boustrophedon triangle in A330339 that contains prime(n).
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:
a(n) = prime(n) + 1 - 2 * A008347(n) if n is even,
a(n) = 2 * A008347(n) - prime(n) if n is odd.
The sequence that ties all these sequences together is A330547 (q.v.).
First negative term is a(146) = -2.
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.
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
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
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..20000
Eric Angelini, Illustration of beginning of the triangle in A330339.
Hans Havermann, Plot of 4*10^8 terms of A330545, sampled every 1000 terms, points joined.
Hans Havermann, More detailed view of terms of A330545 from 290 million to 310 million, sampled every 10 terms, points joined.
N. J. A. Sloane, Illustration of first 16 rows of A330545.
N. J. A. Sloane, State diagram for columns of A330545.
Frank Stevenson, Plot of first 10^10 terms of A330547, sampled every 10^5 steps. Havermann's plot of 4*10^8 terms appears at the very start of this plot.
Frank Stevenson, Plot of first 10^11 terms of A330547, sampled every 10^6 steps. The preceding plot of 10^10 terms can be seen to the left of the blue line.
Frank Stevenson, Plot of first 10^12 terms of A330547, sampled every 10^7 steps. The preceding plot of 10^11 terms can be seen to the left of the blue line.
Walter Trump, An extended picture of the triangle in A330339, showing the first 550 rows, down to the row that starts 3989. [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.]
Walter Trump, An extended picture of the triangle in A330339, showing the first 550 rows, down to the row that starts 3989. [Same picture as the previous one, but with 6 red dots added to show the primes in column 0.]
FORMULA
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}.
MATHEMATICA
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Dec 17 2019
EXTENSIONS
Keyword nonn changed to sign by Hans Havermann, Dec 27 2019
STATUS
approved