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!)
A026233 a(n) = j if n is the j-th prime, else a(n) = k if n is the k-th nonprime. 10
1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 5, 7, 6, 8, 9, 10, 7, 11, 8, 12, 13, 14, 9, 15, 16, 17, 18, 19, 10, 20, 11, 21, 22, 23, 24, 25, 12, 26, 27, 28, 13, 29, 14, 30, 31, 32, 15, 33, 34, 35, 36, 37, 16, 38, 39, 40, 41, 42, 17, 43, 18, 44, 45, 46, 47, 48 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Each n occurs at two positions, the distances between them are: 1, 1, 1, 1, 2, 3, 5, 5, 8, 13, 13, 17, 20, 21, 23, 28, 33, 34, 39, 41, 41, ... - Zak Seidov, Mar 06 2011
LINKS
FORMULA
a(n) = A049084(n) + A066246(n) + A000007(A010051(n)). - Reinhard Zumkeller, Feb 12 2014
a(n) = A049084(n) + A239968(n). - Reinhard Zumkeller, Mar 30 2014
MATHEMATICA
m=100; pr=Prime[Range[m]]; npr=Select[Range[m], !PrimeQ[#]&];
a[n_]:=If[PrimeQ[n], PrimePi[n], Position[npr, n][[1, 1]]]; Table[a[n], {n, m}] (* Zak Seidov Mar 05 2011 *) s=Range[500]; Do[s=Insert[s, n, Prime[n]], {n, 100}]; s (* Zak Seidov, Mar 05 2011 *)
PROG
(Haskell)
a026233 n = a049084 n + a239968 n
-- Reinhard Zumkeller, Mar 30 2014, Feb 12 2014
(PARI) first(n)=my(p, c); vector(n, k, if(isprime(k), p++, c++)) \\ Charles R Greathouse IV, Sep 02 2015
CROSSREFS
Cf. A026238.
Sequence in context: A256991 A267110 A026261 * A222422 A194204 A348110
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 08:11 EDT 2024. Contains 371905 sequences. (Running on oeis4.)