The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A237739 a(0) = 1, a(2n) = nthcomposite(a(n)-1), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040. 5
1, 2, 4, 3, 8, 7, 6, 5, 14, 19, 12, 17, 10, 13, 9, 11, 22, 43, 28, 67, 20, 37, 26, 59, 16, 29, 21, 41, 15, 23, 18, 31, 33, 79, 60, 191, 40, 107, 91, 331, 30, 71, 52, 157, 38, 101, 81, 277, 25, 53, 42, 109, 32, 73, 57, 179, 24, 47, 34, 83, 27, 61, 45, 127, 48 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
A071574(a(n)) = n; a(A071574(n)) = n for n > 0.
LINKS
Reinhard Zumkeller (terms 0-300) & Antti Karttunen, Table of n, a(n) for n = 0..4095
FORMULA
a(0) = 1, a(2n) = nthcomposite(a(n)-1), a(2n+1) = nthprime(a(n)), where nthcomposite = A002808, nthprime = A000040. - Antti Karttunen, Apr 04 2015
PROG
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a237739 = fromIntegral . (+ 1) . fromJust . (`elemIndex` a071574_list)
(PARI)
default(primelimit, (2^31)+(2^30));
A002808(n) = { my(k=-1); while( -n + n += -k + k=primepi(n), ); n }; \\ This function from M. F. Hasler
A237739(n) = if(0==n, 1, if(!(n%2), A002808(A237739(n/2)-1), prime(A237739((n-1)/2))));
for(n=0, 4095, write("b237739.txt", n, " ", A237739(n)));
\\ Antti Karttunen, Apr 04 2015
(Scheme, with memoizing definec-macro)
(definec (A237739 n) (cond ((zero? n) 1) ((odd? n) (A000040 (A237739 (/ (- n 1) 2)))) (else (A002808 (+ -1 (A237739 (/ n 2)))))))
;; Antti Karttunen, Apr 04 2015
CROSSREFS
Inverse: A071574.
Compare also to the permutation A246378.
Sequence in context: A125566 A255833 A166133 * A337909 A358523 A365930
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Apr 30 2014
EXTENSIONS
Name replaced by an explicit recurrence. - Antti Karttunen, Apr 04 2015
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 May 26 23:01 EDT 2024. Contains 372847 sequences. (Running on oeis4.)