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.

Showing 1-6 of 6 results.

A330339 Boustrophedon primes: write the numbers 0, 1, 2, 3, ... in a triangle on a square grid in the boustrophedon manner, ending a row when a prime is reached; sequence lists primes that appear in the zeroth column.

Original entry on oeis.org

37, 53, 89, 113, 3821, 3989, 4657, 28661, 29021, 41641, 41669, 44249, 50909, 56053, 57041, 57301, 133981, 16501361, 46178761, 47633441, 47633477, 47722049, 47736121, 47774621, 47803477, 47810209, 47835013, 47835341, 47854969, 47862413, 47865017, 49448573, 49448617
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2019, following a suggestion from Eric Angelini. a(5) and a(6) were found by Walter Trump. a(7)-a(17) from N. J. A. Sloane, Dec 17 2019

Keywords

Comments

Eric Angelini's illustration shows the first 19 rows of the triangle. Each row ends when a prime is reached, and the next row starts directly under this prime but moves in the opposite direction.
The extended illustration from Walter Trump resembles a giant ski run.
Hans Havermann's plots of A330545, linked here, extend Walter Trump's graph to 4*10^8 rows (probably the longest ski run in the world). Only the turns are shown, and the illustration has been turned sideways.
A330545(k) = 0 iff prime(k) is a term of the present sequence. In a sense A330545 and the simpler A330547 are the more fundamental sequences and show the connection between the present problem and the ordinary primes and their alternating sums.
Note that because primes > 2 are odd, a prime can only appear in column 0 at the end of a row that is moving towards the left. A prime appearing in a row moving to the right will always appear in an odd-numbered column (and in particular, not in the zero column).
Furthermore 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). In particular, a(n) == 1 mod 4. - N. J. A. Sloane, Jan 04 2020
Note that the primes > 2 in column one and two are the primes in A282178.
Note on the links: The illustrations from Angelini and Trump show all the terms 0,1,2,3,4,..., while those of Havermann and Sloane just show the primes (as in A330545).

Crossrefs

A330546 gives the list of indices i such that a(n) = prime(i).
A127596 is another sequence with a similar flavor.
Not to be confused with A000747 = Boustrophedon transform of primes.

Extensions

More terms from Hans Havermann, Dec 17 2019

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).

Original entry on oeis.org

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
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2019

Keywords

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

Crossrefs

Programs

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}.

Extensions

Keyword nonn changed to sign by Hans Havermann, Dec 27 2019

A127596 Numbers k such that 1 + Sum_{i=1..k-1} A001223(i)*(-1)^i = 0.

Original entry on oeis.org

2, 4, 14, 22, 28, 233, 249, 261, 488, 497, 511, 515, 519, 526, 531, 534, 548, 562, 620, 633, 635, 2985, 3119, 3123, 3128, 3157, 4350, 4358, 4392, 4438, 4474, 4484, 4606, 4610, 4759, 5191, 12493, 1761067, 2785124, 2785152, 2785718, 2785729, 2867471
Offset: 1

Views

Author

Manuel Valdivia, Apr 03 2007

Keywords

Comments

Or, with prime(0) = 1, numbers k such that Sum_{i=0..k-1} (prime(i+1)-prime(i))*(-1)^i = Sum_{i=0..k-1} (A008578(i+1)-A008578(i))*(-1)^i = 0.
There are 313 terms < 10^7, 846 terms < 10^8, 1161 terms < 10^9.

Examples

			1 - A001223(1) = 1 - 1 = 0, hence 2 is a term.
1 - A001223(1) + A001223(2) - A001223(3) = 1 - 1 + 2 - 2 = 0, hence 4 is a term.
		

Crossrefs

Cf. A001223 (differences between consecutive primes), A008578 (prime numbers at the beginning of the 20th century), A000101 (increasing gaps between primes, upper end), A002386 (increasing gaps between primes, lower end).
Cf. A282178 (prime(a(n))), A330545, A330547.

Programs

  • Mathematica
    S=0; Do[j=Prime[n+1]; i=Prime[n]; d[n]=j-i; S=S+(d[n]*(-1)^n); If[S+1==0, Print[Table[j|PrimePi[j]|S+1]]], {n,1,10^7,1}]
  • PARI
    {m=10^8; n=1; p=1; e=1; s=0; while(nKlaus Brockhaus, Apr 29 2007 */

Extensions

Edited by Klaus Brockhaus, Apr 29 2007

A282178 Primes for which the sum of all preceding odd-indexed prime gaps is exactly one greater than the sum of all preceding even-indexed prime gaps.

Original entry on oeis.org

3, 7, 43, 79, 107, 1471, 1579, 1663, 3491, 3547, 3659, 3691, 3719, 3779, 3823, 3851, 3947, 4079, 4583, 4679, 4703, 27271, 28643, 28663, 28711, 29023, 41603, 41651, 41999, 42443, 42787, 42899, 44263, 44279, 45971, 50599, 133979, 28335623
Offset: 1

Views

Author

Samuel B. Reid, Feb 07 2017

Keywords

Comments

If the counting numbers 1, 2, 3, ... are written out sequentially such that one unit is moved in a given direction each time a new number is written and such that the direction is reversed if and only if a prime number is reached, these are the primes that lie directly below the number 1.
Comments from N. J. A. Sloane, Dec 21 2019: (Start)
Let p(k) = k-th prime, Delta p(k) = p(k+1)-p(k). The sequence contains those primes q such that
Sum_{k odd, p(k+1) <= q} Delta p(k) = 1 + Sum_{k even, p(k+1) <= q} Delta p(k).
The boustrophedon path described in the first comment can be drawn as follows (it is very similar to the path in A330339):
-2.-1| 0..1..2..3..4..5..6..7..8..
----------------------------------
.....|.1..2
.....|.3
.....|....4..5
.....|.7..6
.....|....8..9.10.11
.....|......13.12
.....|.........14.15.16.17
.....|............19.18
.....|...............20.21.22.23
.....|......29.28.27.26.25.24
.....|.........30.31
37.36|35.34.33.32
...
The primes that fall in column 0 make up the sequence.
Thanks to Walter Trump for pointing out that this sequence is very similar to the Boustrophedon Primes sequence of A330339, and for correcting an omission in an earlier version of these comments.
The close relationship between the two sequences is demonstrated by the fact that the Boustrophedon Primes occur exactly when A330545 is 0, whereas the primes in the present sequence occur exactly when A330545 is 1 or 2.
Yet another way to relate the two sequences is to say that the present sequence gives all the primes > 2 in columns 1 and 2 of the triangle in A330339.
(End)
The primes (other than 2) occur only in even-numbered columns: primes congruent to 3 mod 4 occur in columns congruent to 0 mod 4, and primes congruent to 1 mod 4 occur in columns congruent to 2 mod 4. See the "Notes" link for proof. In particular, a(n) == 3 mod 4.- N. J. A. Sloane, Jan 04 2020
Frank Stevenson's data seems to suggest that a(n) is roughly growing like n^c where c is about 2.74. - N. J. A. Sloane, Dec 31 2019

Crossrefs

Cf. A001223, A330339 (Boustrophedon primes), A330545, A330547, A278603.
The indices of these primes are given by A127596.

Programs

  • Mathematica
    With[{s = Differences@ Prime@ Range[10^5]}, Prime[1 + Position[Array[Total@ Take[s, {1, #, 2}] - Total@ Take[s, {2, #, 2}] &, Length@ s], 1][[All, 1]] ] ]
  • PARI
    my(a=2,n=1,pp=2);forprime(p=3,47000000,n++;a+= (-1)^(n+1)*(p-pp);if(a==1,print1(p,", "));pp=p) \\ Hugo Pfoertner, Dec 23 2019

A330554 Union of 2, A282178, and A330339.

Original entry on oeis.org

2, 3, 7, 37, 43, 53, 79, 89, 107, 113, 1471, 1579, 1663, 3491, 3547, 3659, 3691, 3719, 3779, 3821, 3823, 3851, 3947, 3989, 4079, 4583, 4657, 4679, 4703, 27271, 28643, 28661, 28663, 28711, 29021, 29023, 41603, 41641, 41651, 41669, 41999, 42443, 42787, 42899, 44249, 44263, 44279, 45971, 50599, 50909, 56053, 57041
Offset: 1

Views

Author

N. J. A. Sloane, Dec 22 2019

Keywords

Comments

Equivalently, primes that occur in columns 0, 1, or 2 of the triangle in A330339. [Corrected by Walter Trump, Dec 23 2019]
The asymptotic behavior of A282178 and A330339 is a mystery. It is not even known if they are infinite. They are closely related. A282178 contains primes == 3 mod 4, and A330339 primes == 1 mod 4. Perhaps by combining them in this way some properties will become more visible.

Crossrefs

A355726 a(n) = a(n-2) + prime(n-1) for a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 2, 3, 7, 10, 18, 23, 35, 42, 58, 71, 89, 108, 130, 151, 177, 204, 236, 265, 303, 336, 376, 415, 459, 504, 556, 605, 659, 712, 768, 825, 895, 956, 1032, 1095, 1181, 1246, 1338, 1409, 1505, 1582, 1684, 1763, 1875, 1956, 2072, 2155, 2283, 2378, 2510
Offset: 0

Views

Author

Paul Curtz, Jul 15 2022

Keywords

Crossrefs

Cf. A077131 (even bisection), A077126 (odd bisection).
Cf. A008347 (first differences), (-1)^n*A330547 (second differences).

Programs

  • Mathematica
    Join[{0},Accumulate[FoldList[#2-#1&,0,Prime[Range[100]]]]] (* Paolo Xausa, Dec 04 2023 *)

Formula

a(2*n) = A077131(n), for n>=1.
a(2*n+1) = A077126(n), for n>=1.
Showing 1-6 of 6 results.