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!)
A318158 Prime numbers of the form p1^4 + p2^3 + p3^2 + p4, where p1, p2, p3 and p4 are distinct primes. 1

%I #20 Aug 26 2018 11:32:05

%S 79,97,103,109,127,131,137,139,149,151,157,163,167,173,179,181,191,

%T 193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,

%U 283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397

%N Prime numbers of the form p1^4 + p2^3 + p3^2 + p4, where p1, p2, p3 and p4 are distinct primes.

%C Does this sequence contain every prime > 113? - _Robert Israel_, Aug 26 2018

%C From _David A. Corneth_, Aug 26 2018: (Start)

%C As the primes in the sum are distinct and has four terms, exactly one of (p1, p2, p3, p4) is 2.

%C Contains all the primes in [120, 5 * 10^7]. (End)

%H Robert Israel, <a href="/A318158/b318158.txt">Table of n, a(n) for n = 1..10000</a>

%H David A. Corneth, <a href="/A318158/a318158.gp.txt">Statistic for computations using the PARI program below</a>

%H David A. Corneth, <a href="/A318158/a318158_1.gp.txt">PARI program</a>

%e 227 belongs to this sequence as 227 = 3^4 + 5^3 + 2^2 + 17, with 2, 3, 5 and 17 all primes.

%p N:= 1000: # to get all terms <= N

%p V:= Vector(N):

%p p1:= 1:

%p do

%p p1:= nextprime(p1);

%p if p1^4 > N then break fi;

%p p2:= 1:

%p do

%p p2:= nextprime(p2);

%p if p1^4 + p2^3 > N then break fi;

%p if p2 = p1 then next fi;

%p p3:= 1;

%p do

%p p3:= nextprime(p3);

%p if p1^4 + p2^3 + p3^2 > N then break fi;

%p if p3 = p1 or p3 = p2 then next fi;

%p if min(p1,p2,p3)>2 then

%p p4:= 2;

%p x:= p1^4+p2^3+p3^2+p4;

%p if isprime(x) then V[x]:= 1 fi;

%p else

%p p4:= 2;

%p do

%p p4:= nextprime(p4);

%p if p1^4 + p2^3 + p3^2 + p4 > N then break fi;

%p if p4 = p1 or p4 = p2 or p4 = p3 then next fi;

%p x:= p1^4+p2^3+p3^2+p4;

%p if isprime(x) then V[x]:= 1 fi;

%p od

%p fi

%p od od od:

%p select(t -> V[t]=1, [$1..N]); # _Robert Israel_, Aug 26 2018

%t v[t_] := Prime@Range@PrimePi@t; up = 400; Union@Reap[ Do[ If[PrimeQ[p = p1^4 + p2^3 + p3^2 + p4] && (s = {p1, p2, p3, p4}; Sort@s == Union@s), Sow@p], {p1, v[ up^(1/4)]}, {p2, v@Sqrt[up - p1^4]}, {p3, v[up - p1^4 - p2^3]}, {p4, v[up - p1^4 - p2^3 - p3^2]}]][[2, 1]] (* _Giovanni Resta_, Aug 19 2018 *)

%o (Minizinc)

%o include "globals.mzn";

%o int: n = 4;

%o %to get all primes less than 250 of this sequence

%o int: max_val = 250;

%o array[1..n+1] of var 2..max_val: x;

%o % primes between 2..max_valset of int:

%o prime = 2..max_val diff { i | i in 2..max_val, j in 2..ceil(sqrt(i)) where i mod j = 0} ;

%o set of int: primes;

%o primes = prime union {2};

%o solve satisfy;

%o constraint all_different(x) /\

%o x[1] in primes /\

%o x[2] in primes /\

%o x[3] in primes /\

%o x[4] in primes /\

%o x[5] in primes /\

%o pow(x[4],4)+pow(x[3],3)+pow(x[2],2)+pow(x[1],1)= x[5] ;

%o output [ show(x[5])]

%Y Cf. A316971.

%K nonn

%O 1,1

%A _Pierandrea Formusa_, Aug 19 2018

%E More terms from _Giovanni Resta_, Aug 19 2018

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 25 12:53 EDT 2024. Contains 371969 sequences. (Running on oeis4.)