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!)
A014684 In the sequence of positive integers subtract 1 from each prime number. 12

%I #33 Oct 14 2023 11:36:27

%S 1,1,2,4,4,6,6,8,9,10,10,12,12,14,15,16,16,18,18,20,21,22,22,24,25,26,

%T 27,28,28,30,30,32,33,34,35,36,36,38,39,40,40,42,42,44,45,46,46,48,49,

%U 50,51,52,52,54,55,56,57,58,58,60,60,62,63,64,65,66,66,68,69,70,70,72

%N In the sequence of positive integers subtract 1 from each prime number.

%H Reinhard Zumkeller, <a href="/A014684/b014684.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A005171(n) + n - 1.

%F a(n) = phi(n!)/phi((n-1)!). - _Vladeta Jovovic_, Nov 30 2002

%F For n > 3: a(n) = A113523(n) = A179278(n). - _Reinhard Zumkeller_, Jul 08 2010

%F a(n) = n - A010051(n). - _Reinhard Zumkeller_, Sep 10 2013

%t Table[If[PrimeQ[n],n-1,n],{n,100}] (* _Harvey P. Dale_, Aug 27 2015 *)

%o (Haskell)

%o a014684 n = n - fromIntegral (a010051 n)

%o -- _Reinhard Zumkeller_, Sep 10 2013

%o (Magma) [n - (IsPrime(n) select 1 else 0): n in [1..80]]; // _Bruno Berselli_, Jul 18 2016

%o (Python)

%o from sympy import isprime

%o def A014684(n): return n-int(isprime(n)) # _Chai Wah Wu_, Oct 14 2023

%Y Cf. A000010, A048855, A113638.

%K nonn,easy

%O 1,3

%A _Mohammad K. Azarian_

%E More terms from Andrew J. Gacek (andrew(AT)dgi.net)

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 26 09:43 EDT 2024. Contains 371994 sequences. (Running on oeis4.)