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

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

%S 1,7,10,17,52,69,108,161,173,231,306,330,338,352,416,582,584,593,635,

%T 767,834,855,868,892,927,944,950,1044,1060,1203,1242,1299,1302,1509,

%U 1520,1551,1637,1972,2067,2078,2135,2303,2310,2366,2416,2511,2514,2556,2581

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

%H Vincenzo Librandi, <a href="/A124187/b124187.txt">Table of n, a(n) for n = 1..258</a>

%p a:= proc(n) option remember; local k;

%p for k from 1+ a(n-1) while

%p not isprime(1+(k^37-k)/(k^2-1)) do od; k

%p end: a(1):=1:

%p seq(a(n), n=1..30); # _Alois P. Heinz_, Jun 26 2014

%t Do[If[PrimeQ[1+n+n^3+n^5+n^7+n^9+n^11+n^13+n^15+n^17+n^19+n^21+n^23 +n^25 +n^27 +n^29+n^31+n^33+n^35],Print[n]],{n,1,2400}]

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

%o (PARI) for(n=1,10^4,if(ispseudoprime(sum(i=0,17,n^(2*i+1))+1),print1(n,", "))) \\ _Derek Orr_, Jun 24 2014

%o (Magma) [n: n in [0..4000] | IsPrime(1+n*(1+n^2)*(1+n^4+n^8)*(1+n^12+n^24))]; // _Vincenzo Librandi_, Jun 27 2014

%Y Cf. A049407.

%K nonn

%O 1,2

%A _Artur Jasinski_, Dec 13 2006

%E a(45) and beyond from _Derek Orr_, Jun 24 2014