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!)
A175851 a(n) = 1 for noncomposite n, a(n) = n - previousprime(n) + 1 for composite n. 14

%I #25 Dec 19 2021 04:28:40

%S 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,

%T 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,

%U 3,4,1,2,1,2,3,4,5,6,1,2,3,4

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

%C 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.

%C 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

%H Antti Karttunen, <a href="/A175851/b175851.txt">Table of n, a(n) for n = 1..65537</a>

%F 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.

%t a[n_] := If[!CompositeQ[n], 1, n - NextPrime[n, -1] + 1];

%t Array[a, 100] (* _Jean-François Alcover_, Dec 19 2021 *)

%o (PARI) A175851(n) = if(1==n,n,1 + n - precprime(n)); \\ _Antti Karttunen_, Mar 04 2018

%Y Cf. A000720, A007917, A008578, A151799, A151800, A305300.

%Y Cf. A065358 for another way of visualizing prime gaps.

%Y Cf. A304106 (ordinal transform of this sequence).

%Y Cf. A049711.

%K nonn,look

%O 1,4

%A _Jaroslav Krizek_, Sep 29 2010

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 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)