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

%I #17 Sep 08 2022 08:46:08

%S 15,56,65,74,87,104,132,150,171,185,186,204,225,234,360,429,449,455,

%T 459,476,485,512,675,746,770,780,795,816,836,839,840,846,857,876,902,

%U 930,939,941,944,977,1109,1152,1161,1190,1262,1289,1295,1316,1355,1362,1374,1395,1401,1425

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

%H Chai Wah Wu, <a href="/A243318/b243318.txt">Table of n, a(n) for n = 1..2470</a>

%e 15^10 - 15^9 - 15^8 - 15^7 - 15^6 - 15^5 - 15^4 - 15^3 - 15^2 - 15 - 1 = 535461077009 is prime. Thus 15 is a member of this sequence.

%p A243318:=n->`if`(isprime(n^10-add(n^i, i=0..9)), n, NULL): seq(A243318(n), n=1..2*10^3); # _Wesley Ivan Hurt_, Dec 05 2016

%t Select[Range[2000], PrimeQ[#^10 - #^9 - #^8 - #^7 - #^6 - #^5 - #^4 - #^3 - #^2 - # - 1] &] (* _Vincenzo Librandi_, Dec 06 2016 *)

%o (Python)

%o import sympy

%o from sympy import isprime

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

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

%o (Python)

%o from sympy import isprime

%o A243318_list, m = [], [3628800, -16692480, 31651200, -31827600, 18163440, -5826240, 971232, -69720, 1362, -2, -1]

%o for n in range(1,10**5+1):

%o ....for i in range(10):

%o ........m[i+1]+= m[i]

%o ....if isprime(m[-1]):

%o ........A243318_list.append(n) # _Chai Wah Wu_, Nov 06 2014

%o (Magma) [n: n in [0..2000] | IsPrime(n^10-n^9-n^8-n^7-n^6- n^5-n^4-n^3-n^2-n-1)]; // _Vincenzo Librandi_, Dec 06 2016

%Y Cf. A162862.

%K nonn

%O 1,1

%A _Derek Orr_, Jun 03 2014