|
|
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).
|
|
7
|
|
|
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, 14, 23, 22, 27, 22, 25, 20, 25, 24, 33, 32, 35, 34, 45, 34, 37, 36, 39, 34, 35, 26, 31, 26, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(n) is the column of the Boustrophedon triangle in A330339 that contains prime(n).
If a(n) = 0 then p = prime(n) is a term of A330339, and n is a term of A330546.
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
For large n, the graphs of A330545 and A330547 are essentially identical.
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
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|