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!)
A096457 If n is prime replace n with the next prime. 1

%I #7 Jul 05 2019 15:34:43

%S 1,3,5,4,7,6,11,8,9,10,13,12,17,14,15,16,19,18,23,20,21,22,29,24,25,

%T 26,27,28,31,30,37,32,33,34,35,36,41,38,39,40,43,42,47,44,45,46,53,48,

%U 49,50,51,52,59,54,55,56,57,58,61,60,67,62,63,64,65,66,71,68,69,70,73,72

%N If n is prime replace n with the next prime.

%H Harvey P. Dale, <a href="/A096457/b096457.txt">Table of n, a(n) for n = 1..1000</a>

%e For n = prime 7, nextprime(7+1) = 11 = a(7).

%t Table[If[PrimeQ[n],NextPrime[n],n],{n,80}] (* _Harvey P. Dale_, Jul 05 2019 *)

%o (PARI) f(n) = for(x=1,n,if(isprime(x),y=nextprime(x+1),y=x);print1(y","))

%K nonn

%O 1,2

%A _Cino Hilliard_, Aug 11 2004

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 March 28 10:55 EDT 2024. Contains 371241 sequences. (Running on oeis4.)