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.

A162203 The mountain path of the primes (see comment lines for definition).

This page as a plain text file.
%I A162203 #17 Mar 02 2023 16:52:50
%S A162203 2,2,2,3,1,-1,1,3,1,-1,1,3,1,-3,1,4,1,-2,1,5,1,-1,1,3,1,-3,1,6,1,-2,1,
%T A162203 4,1,-3,1,3,1,-2,1,5,1,-3,1,7,1,-4,1,3,1,-1,1,3,1,-1,1,9,1,-7,1,5,1,
%U A162203 -2,1,6,1,-4,1,4,1,-4,1,5,1,-3,1,6,1,-2,1,6
%N A162203 The mountain path of the primes (see comment lines for definition).
%C A162203 On the infinite square grid we draw an infinite straight line from the point (1,0) in direction (2,1).
%C A162203 We start at stage 1 from the point (0,0) drawing an edge ((0,0),(2,0)) in a horizontal direction.
%C A162203 At stage 2 we draw an edge ((2,0),(2,2)) in a vertical direction. We can see that the straight line intercepts at the number 3 (the first odd prime).
%C A162203 At stage 3 we draw an edge ((2,2),(4,2)) in a horizontal direction. We can see that the straight line intercepts at the number 5 (the second odd prime).
%C A162203 And so on (see illustrations).
%C A162203 The absolute value of a(n) is equal to the length of the n-th edge of a path, or infinite square polyedge, such that the mentioned straight line intercepts, on the path, at the number 1 and the odd primes. In other words, the straight line intercepts the odd noncomposite numbers (A006005).
%C A162203 The position of the x-th odd noncomposite number A006005(x) is represented by the point P(x,x-1).
%C A162203 So the position of the first prime number is represented by the point P(2,0) and position of the x-th prime A000040(x), for x>1, is represented by the point P(x,x-1); for example, 31, the 11th prime, is represented by the point P(11,10).
%C A162203 See also A162200, A162201 and A162202 for more information.
%H A162203 Antti Karttunen, <a href="/A162203/b162203.txt">Table of n, a(n) for n = 1..20000</a>
%H A162203 Omar E. Pol, <a href="http://www.polprimos.com/imagenespub/polmpfpn.jpg"> Graph of the mountain path function for prime numbers</a>
%H A162203 Omar E. Pol, <a href="http://www.polprimos.com/imagenespub/polmpca1.jpg"> Illustration: The mountain path of the primes</a>
%F A162203 From _Nathaniel Johnston_, May 10 2011: (Start)
%F A162203 a(2n+1) = 1 for n >= 2.
%F A162203 a(2n) = (-1)^n*(A162341(n+2) - 1) = (-1)^n*(A052288(n) - 1) + 1 for n >= 2. (End)
%e A162203 Array begins:
%e A162203 =====
%e A162203 X..Y
%e A162203 =====
%e A162203 2, 2;
%e A162203 2, 3;
%e A162203 1,-1;
%e A162203 1, 3;
%e A162203 1,-1;
%e A162203 1, 3;
%e A162203 1,-3;
%e A162203 1, 4;
%e A162203 1,-2;
%e A162203 1, 5;
%o A162203 (PARI)
%o A162203 \\ (After Nathaniel Johnston_'s formula):
%o A162203 A052288(n) = ((prime(n+3) - prime(n+1))/2);
%o A162203 A162203(n) = if(n<=3, 2, if(n%2, 1, 1+((-1)^(n/2)*(A052288(n/2)-1)))); \\ _Antti Karttunen_, Mar 02 2023
%Y A162203 Cf. A000040, A006005, A008578, A162200, A162201, A162202, A162340, A162341, A162342, A162343, A162344.
%K A162203 easy,sign
%O A162203 1,1
%A A162203 _Omar E. Pol_, Jun 27 2009
%E A162203 Edited by _Omar E. Pol_, Jul 02 2009
%E A162203 More terms from _Nathaniel Johnston_, May 10 2011