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.

A175851 a(n) = 1 for noncomposite n, a(n) = n - previousprime(n) + 1 for composite n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4
Offset: 1

Views

Author

Jaroslav Krizek, Sep 29 2010

Keywords

Comments

Sequence is cardinal and not fractal. Cardinal sequence is sequence with infinitely many times occurring all natural numbers. Fractal sequence is sequence such that when the first instance of each number in the sequence is erased, the original sequence remains.
Ordinal transform of the nextprime function, A151800(1..) = 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, ..., also ordinal transform of A304106. - Antti Karttunen, Jun 09 2018

Crossrefs

Cf. A065358 for another way of visualizing prime gaps.
Cf. A304106 (ordinal transform of this sequence).
Cf. A049711.

Programs

Formula

a(1) = 1, a(n) = n - A007917(n) + 1 for n >= 2. a(1) = 1, a(2) = 1, a(n) = n - A151799(n+1) + 1 for n >= 3.
a(n) = Sum_{i=1..n} floor(pi(i)/pi(n)), for n>1 with pi(n) = A000720(n). - Ridouane Oudra, Jun 24 2024
a(n) = A049711(n+1), for n>1. - Ridouane Oudra, Jul 16 2024