login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A230850 A054541 and A000012 interleaved. 4
2, 1, 1, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 4, 1, 6, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 6, 1, 4, 1, 6, 1, 8, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 14, 1, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 6, 1, 4, 1, 6, 1, 6, 1, 2, 1, 10, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) is also the length of the n-th edge of a staircase which represents the function pi(x) on the first quadrant of the square grid, see A000720.
a(2n-1) is the length of the n-th horizontal edge in the staircase.
a(2n) is the length of the n-th vertical edge in the staircase.
For another version see A230849.
LINKS
FORMULA
a(1) = 2; for n > 1, a(n) = A230849(n). - Antti Karttunen, Dec 23 2018
EXAMPLE
Illustration of initial terms, n = 1..22:
.
1 _ _|
1 _ _ _ _ _ _|
1 _ _ _ _|
1 _ _|
1 _ _ _ _|
1 _ _|
1 _ _ _ _|
1 _ _|
1 _ _|
1 _|
1 _ _|
.
. 2 1 2 2 4 2 4 2 4 6 2
.
Drawing vertical line segments below the staircase (as shown below) we have that the number of cells in the vertical bars gives 0 together A000720.
Drawing horizontal line segments above the staircase we have that the number of cells in the k-th horizontal bar is A000040(k).
. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
29 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
23 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
19 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
17 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
13 |_ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
11 |_ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
7 |_ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
5 |_ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
3 |_ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
2 |_ _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
. 0 0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
.
MATHEMATICA
Riffle[Join[{2}, Differences[Prime[Range[100]]]], 1] (* Paolo Xausa, Oct 31 2023 *)
PROG
(PARI) A230850(n) = if(1==n, 2, if((n%2), prime((n+1)/2)-prime(((n+1)/2)-1), 1)); \\ Antti Karttunen, Dec 23 2018
CROSSREFS
Sequence in context: A361746 A369917 A319608 * A072085 A054868 A352517
KEYWORD
nonn
AUTHOR
Omar E. Pol, Oct 31 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 13:32 EDT 2024. Contains 371971 sequences. (Running on oeis4.)