login
Numbers n such that 1 + n + n^3 + n^5 + n^7 + n^9 is prime.
5

%I #20 Sep 08 2022 08:45:28

%S 2,12,14,18,48,62,80,86,116,120,138,212,230,264,272,362,368,386,392,

%T 422,440,450,456,468,480,492,510,518,528,534,548,558,620,632,678,710,

%U 744,770,780,834,884,900,918,960,1022,1032,1074,1080,1146,1170,1178,1212,1232,1242,1260,1308,1382,1440,1470,1482,1524

%N Numbers n such that 1 + n + n^3 + n^5 + n^7 + n^9 is prime.

%H Vincenzo Librandi, <a href="/A124163/b124163.txt">Table of n, a(n) for n = 1..1000</a>

%t Do[If[PrimeQ[1 + n + n^3 + n^5 + n^7 + n^9], Print[n]], {n, 1, 300}]

%t Select[Range[2000], PrimeQ[Total[#^Range[1, 9, 2]] + 1] &] (* _Vincenzo Librandi_, Jun 27 2014 *)

%o (Magma) [n: n in [0..1500]| IsPrime(1 + n + n^3 + n^5 + n^7+ n^9 )]; // _Vincenzo Librandi_, Nov 13 2010

%o (Magma) [n: n in [0..1200] | IsPrime(s) where s is 1+&+[n^i: i in [1..9 by 2]]]; // _Vincenzo Librandi_, Jun 27 2014

%o (PARI) is(n)=isprime(1+n+n^3+n^5+n^7+n^9) \\ _Charles R Greathouse IV_, Feb 20 2017

%Y Cf. A049407, similar sequences listed in A244376.

%K nonn,easy

%O 1,1

%A _Artur Jasinski_, Dec 13 2006