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!)
A241082 a(n) = n for 1 and prime numbers. For composite numbers, first prime term in sequence starting with n and each time adding smallest prime number not a divisor of the preceding term. 0
1, 2, 3, 7, 5, 11, 7, 11, 11, 13, 11, 17, 13, 17, 17, 19, 17, 23, 19, 23, 23, 29, 23, 29, 29, 29, 29, 31, 29, 37, 31, 37, 37, 37, 37, 41, 37, 41, 41, 43, 41, 47, 43, 47, 47, 53, 47, 53, 53, 53, 53, 59, 53, 59, 59, 59, 59, 61, 59, 67, 61, 67, 67, 67, 67, 71 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(22) = 29 because the smallest prime number not a divisor of 22 is 3, and 22+3=25, and 25 is composite, and the smallest prime number not a divisor of 25 is 2, and 25+2=27, and 27 is composite, and the smallest prime number not a divisor of 27 is 2, and 27+2=29, a prime number.
PROG
(PARI) a(n) = {if ((n==1) || isprime(n), return(n)); k = n; while (! isprime(k), p = 2; while (! (k % p), p = nextprime(p+1)); k += p; ); k; } \\ Michel Marcus, Apr 27 2014
CROSSREFS
Sequence in context: A085102 A087572 A085107 * A219789 A034694 A050921
KEYWORD
nonn
AUTHOR
J. Lowell, Apr 15 2014
EXTENSIONS
More terms from Michel Marcus, Apr 27 2014
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 19 08:20 EDT 2024. Contains 371782 sequences. (Running on oeis4.)