login
The least prime p such that the highest power of 3 that divides p^2 + 2 is n.
2

%I #17 May 03 2015 11:04:14

%S 3,2,13,5,59,751,1237,6053,10427,36671,1532579,351599,356989,12048691,

%T 105931211,96365273,190612867,18425983,1014695321,8763105101,

%U 20385719771,7508555437,97094976593,1911292838383,22999364895631,46158586887073,6373306898393

%N The least prime p such that the highest power of 3 that divides p^2 + 2 is n.

%H Hiroaki Yamanouchi, <a href="/A257568/b257568.txt">Table of n, a(n) for n = 0..500</a>

%e a(0) = 3 because 3^2+2=11 not divisible by 3,

%e a(18) = 1014695321 because 1014695321^2+2 = 3^18*2657594587,

%e a(21) = 7508555437 because 7508555437^2+2 = 3^21*17*317042521.

%o (PARI) a(n)=if(n==1, return(2)); my(k=3^n,m=1,p); while(!issquare(m*k-2,&p) || !isprime(p), m+=2; if(m%3==0, m+=2)); p \\ _Charles R Greathouse IV_, May 01 2015

%Y Cf. A257567.

%K nonn

%O 0,1

%A _Zak Seidov_, Apr 30 2015

%E a(16) corrected and a(22)-a(26) added by _Hiroaki Yamanouchi_, May 03 2015