login
Numbers k such that k^8 - k^7 - k^6 - k^5 - k^4 - k^3 - k^2 - k - 1 is prime.
2

%I #18 Apr 05 2017 03:41:58

%S 4,5,18,23,24,25,39,41,49,61,68,73,100,102,103,109,111,114,125,140,

%T 150,157,158,167,181,210,228,242,245,259,282,286,287,290,294,299,300,

%U 303,307,311,315,325,341,347,364,367,371,385,390,395,403,406,415,430,437,441,444

%N Numbers k such that k^8 - k^7 - k^6 - k^5 - k^4 - k^3 - k^2 - k - 1 is prime.

%H John Cerkan, <a href="/A243297/b243297.txt">Table of n, a(n) for n = 1..10000</a>

%e 4^8 - 4^7 - 4^6 - 4^5 - 4^4 - 4^3 - 4^2 - 4^1 - 1 = 43691 is prime. Thus 4 is a term.

%t Rest@ Select[Range@ 450, Function[n, PrimeQ[Fold[#1 - n^#2 &, n^8, Range@ 7] - 1]]] (* _Michael De Vlieger_, Apr 03 2017 *)

%o (Python)

%o import sympy

%o from sympy import isprime

%o {print(n,end=', ') for n in range(10**3) if isprime(n**8-n**7-n**6-n**5-n**4-n**3-n**2-n-1)}

%o (PARI) for(n=1,10^3,if(ispseudoprime(n^8-sum(i=0,7,n^i)),print1(n,", ")))

%Y Cf. A000040.

%K nonn

%O 1,1

%A _Derek Orr_, Jun 02 2014