login
A128049
Least number k>0 such that abs((3^k - (3-n)^k)/n) is prime, or 0 if no such prime exists.
2
0, 2, 3, 2, 2, 3, 0, 3, 2, 2, 3, 2, 0, 2, 3, 0, 3, 2, 0, 2, 37, 0, 3, 2, 0, 2, 1153, 0, 83, 2, 0, 3, 11, 0, 3, 2, 0, 2, 3, 0, 557, 19, 0, 2, 3, 0, 7, 2, 0, 2, 631, 0, 5, 2, 0, 3, 3, 0, 239, 2, 0, 5, 3, 0, 3, 2, 0, 2, 317, 0, 3, 103, 0, 2, 7, 0, 3, 2, 0, 2, 43
OFFSET
0,2
COMMENTS
a(-n) = A128033(n).
a(3*n) = 0 except a(3) = a(9) = 2.
All positive terms are primes.
LINKS
PROG
(PARI) a(n) = my(p=3); if(isprime(abs(n-6)), 2, if(n%3, while(!ispseudoprime((3^p-(3-n)^p)/n), p=nextprime(p+1)); p, 0)); \\ Jinyuan Wang, Nov 28 2020
CROSSREFS
Cf. A128033 (least number k>0 such that ((n+3)^k - 3^k)/n is prime), A028491 (numbers n such that (3^n - 1)/2 is prime).
Sequence in context: A145390 A270026 A340703 * A104543 A054988 A143393
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, Feb 12 2007
EXTENSIONS
Name changed by Jinyuan Wang, Nov 28 2020
STATUS
approved