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!)
A103864 a(1) = 1; a(n) = smallest positive integer not occurring earlier in sequence if n is a prime. a(n) = a(n-1)th smallest positive integer among those not occurring earlier in sequence if n is composite. 4
1, 2, 3, 6, 4, 9, 5, 12, 20, 29, 7, 16, 8, 19, 33, 48, 10, 24, 11, 27, 46, 67, 13, 32, 55, 80, 106, 133, 14, 36, 15, 39, 68, 99, 132, 167, 17, 43, 75, 111, 18, 47, 21, 53, 91, 135, 22, 57, 98, 146, 196, 247, 23, 60, 105, 157, 212, 269, 25, 64, 26, 69, 121, 180, 242, 307, 28 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
LINKS
EXAMPLE
Since 6 is composite, a(6) = a(5)th (4th) smallest positive integer not occurring earlier in sequence. The terms not occurring earlier in sequence are 5,7,8,9,10... and the 4th of these is 9.
MATHEMATICA
a = {1}; Do[AppendTo[a, Complement[Range[Max[a] + a[[-1]] + 1], a][[If[PrimeQ[n], 1, a[[-1]]]]]], {n, 2, 67}]; a (* Ivan Neretin, May 09 2015 *)
CROSSREFS
Inverse: A103866.
Cf. A103865, A103867 (variant and its inverse).
Sequence in context: A084980 A101369 A125147 * A268712 A152679 A232561
KEYWORD
nonn,look
AUTHOR
Leroy Quet, Feb 18 2005
EXTENSIONS
More terms from John W. Layman, May 27 2005
Corrected by Franklin T. Adams-Watters, Nov 22 2006
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 16 08:27 EDT 2024. Contains 371698 sequences. (Running on oeis4.)