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!)
A026238 a(n) = j if n is the j-th prime, else a(n) = k if n is the k-th composite. 7
1, 2, 1, 3, 2, 4, 3, 4, 5, 5, 6, 6, 7, 8, 9, 7, 10, 8, 11, 12, 13, 9, 14, 15, 16, 17, 18, 10, 19, 11, 20, 21, 22, 23, 24, 12, 25, 26, 27, 13, 28, 14, 29, 30, 31, 15, 32, 33, 34, 35, 36, 16, 37, 38, 39, 40, 41, 17, 42, 18, 43, 44, 45, 46, 47, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,2
LINKS
MATHEMATICA
Table[If[PrimeQ[n], PrimePi[n], n-1-PrimePi[n]], {n, 2, 70}] (* Harvey P. Dale, Jun 06 2017 *)
PROG
(Haskell)
a026238 n = a049084 n + a066246 n -- Reinhard Zumkeller, Jan 29 2014
(PARI) first(n)=my(c, p); vector(n-1, k, if(isprime(k+1), p++, c++)) \\ Charles R Greathouse IV, Sep 02 2015
CROSSREFS
a(n) = A049084(n) + A066246(n).
Sequence in context: A344096 A253138 A283994 * A066136 A257902 A257909
KEYWORD
nonn
AUTHOR
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 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)