OFFSET
1,1
COMMENTS
Sequence is infinite, since any integer congruent to 63064644938 modulo 195435717998430 cannot be the sum of a power of three and a prime.
A282432(a(n)) = 0.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000
EXAMPLE
328 is in the sequence since 328 - 3^0 = 3*109, 328 - 3^1 = 5^2*13, 328 - 3^2 = 11*29, 328 - 3^3 = 7*43, 328 - 3^4 = 13*19, and 328 - 3^5 = 5*17 are all composite.
MATHEMATICA
fQ[n_] := If[ Mod[n, 3] > 0, Block[{lmt = Log[3, n], x = 0}, While[x < lmt && !PrimeQ[n - 3^x], x++]; x > lmt], False]; Select[ 2Range@3000, fQ] (* Robert G. Wilson v, Feb 25 2017 *)
PROG
(Magma) lst:=[]; for n in [0..5974 by 2] do if not n mod 3 eq 0 then x:=-1; repeat x+:=1; p:=n-3^x; until p lt 2 or IsPrime(p); if p lt 2 then Append(~lst, n); end if; end if; end for; lst;
(PARI) isok(n) = {if (n % 2, 0, if (n % 3, lim = log(n)/log(3); for (k=0, lim, if (isprime(n - 3^k), return (0)); ); 1, 0); ); } \\ Michel Marcus, Feb 25 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Arkadiusz Wesolowski, Feb 15 2017
STATUS
approved