login
A282432
Number of primes of the form n - 3^k.
3
0, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 3, 0, 2, 0, 1, 0, 3, 0, 2, 0, 1, 0, 2, 0, 1, 1, 2, 0, 4, 0, 2, 0, 0, 0, 3, 0, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 3, 0, 3, 0, 1, 0, 3, 0, 2, 0, 0, 0, 3, 0, 2, 1, 2, 0, 3, 0, 3, 0, 1, 0, 3, 0, 2, 0, 0, 0, 4, 0, 3, 0, 1, 0, 3, 0
OFFSET
1,6
FORMULA
a(A282430(n)) = 0.
G.f.: ( Sum_{i>=0} x^(3^i) ) * ( Sum_{j>=1} x^prime(j) ). - Ilya Gutkovskiy, Feb 10 2022
EXAMPLE
a(14) = 3; 14 - 3^0 = 13, 14 - 3 = 11, 14 - 3^2 = 5, three primes.
MAPLE
A282432 := proc(n)
a := 0 ;
for k from 0 do
if n-3^k < 2 then
return a ;
elif isprime(n-3^k) then
a := a+1 ;
end if;
end do:
end proc:
seq(A282432(n), n=1..80) ; # R. J. Mathar, Mar 07 2022
PROG
(Magma) lst:=[]; for n in [1..105] do c:=0; e:=Floor(Log(3, n)); k:=0; while k le e do p:=n-3^k; if IsPrime(p) then c+:=1; end if; k+:=1; end while; Append(~lst, c); end for; lst;
(PARI) ispp3(n) = (n==1) || (n==3) || (ispower(n, , &p) && (p==3));
a(n) = {my(nb = 0); forprime(p=2, n, nb += ispp3(n-p); ); nb; } \\ Michel Marcus, Feb 18 2017
CROSSREFS
Sequence in context: A287337 A026612 A287341 * A046922 A193779 A279048
KEYWORD
nonn,easy
AUTHOR
STATUS
approved