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!)
A109314 Numbers n such that prime(n) + n is a prime power (A246547). 2

%I #22 Jun 18 2017 02:38:34

%S 3,5,8,9,12,86,230,503,1170,2660,2772,6288,6572,8858,9590,14870,16332,

%T 17708,53132,54540,63890,64908,82830,93068,98132,104726,119298,136502,

%U 152198,177918,187040,234650,241682,253118,263930,278970,376680,412440,456110,469034

%N Numbers n such that prime(n) + n is a prime power (A246547).

%H Donovan Johnson, <a href="/A109314/b109314.txt">Table of n, a(n) for n = 1..1000</a>

%F prime(n) + n = q^k, q is prime and k_Integer >= 2.

%e 2660 is OK because prime(2660) + 2660 = 23909 + 2660 = 26569 = 163^2, 163 is prime.

%p ispp:= n -> not isprime(n) and nops(numtheory:-factorset(n))=1:

%p p:= 1: Res:= NULL:

%p for n from 1 to 10^6 do

%p p:= nextprime(p);

%p if ispp(n+p) then Res:= Res, n fi

%p od:

%p Res; # _Robert Israel_, Jun 08 2016

%t lst = {}; fQ[n_] := Block[{pf = FactorInteger[n]}, (2-Length[pf])(pf[[1, 2]]-1) > 0]; Do[ If[ fQ[Prime[n] + n], Print[n]; AppendTo[lst, n]], {n, 456109}]; lst

%o (Sage) def np(n): return n+nth_prime(n)

%o [n for n in (1..10000) if not np(n).is_prime() and np(n).is_prime_power()] # _Giuseppe Coppoletta_, Jun 08 2016

%o (PARI) isok(n) = isprimepower(n+prime(n)) >= 2; \\ _Michel Marcus_, Jun 18 2017

%Y Cf. A025475 = powers of a prime but not prime, also nonprime n such that sigma(n)*phi(n) > (n-1)2; A107708 = values of q, A107709 = values of k; A107710 = values of prime (A109314(n)).

%Y Cf. A107605, A246547.

%K nonn

%O 1,1

%A _Zak Seidov_ and _Robert G. Wilson v_, Jun 25 2005

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 July 31 17:27 EDT 2024. Contains 374808 sequences. (Running on oeis4.)