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

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

%S 5,15,140,359,615,876,941,1109,1230,1292,1302,1325,1752,1799,2064,

%T 2535,2645,2690,2942,3042,3138,3200,3449,3473,3527,3560,3713,4070,

%U 4488,4658,4767,5055,5169,5195,5472,5592,5604,5841,5856,5939,6201,6669,6677,6731,6857

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

%H Chai Wah Wu, <a href="/A124209/b124209.txt">Table of n, a(n) for n = 1..1237</a> (n = 1..230 from Vincenzo Librandi)

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

%p for k from 1+`if`(n=1, 1, a(n-1)) while

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

%p end:

%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 + n^37 + n^39 + n^41 + n^43 + n^45 + n^47 + n^49 + n^51 + n^53 + n^55 + n^57 + n^59 + n^61 + n^63],Print[n]],{n,1,2400}]

%t Select[Range[7000], PrimeQ[Total[#^Range[1, 63, 2]] + 1] &] (* _Vincenzo Librandi_, Jun 28 2014 *)

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

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

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

%K nonn,easy

%O 1,1

%A _Artur Jasinski_, Dec 13 2006

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