# [seqfan] Re: Sum of a binary power and an odd prime power

Richard Mathar mathar at strw.leidenuniv.nl
Sun Apr 18 13:45:27 CEST 2010

```Cf. http://list.seqfan.eu/pipermail/seqfan/2010-April/004373.html

With the definition of A115230 as "number of ways to write the n-th prime as A000079(i)+A061345(j), i>=0, j>=0" and keeping the definitions of
the other 3 sequences as intended, I get (to be checked !):

A115230:
1,1,2,2,3,3,3,3,2,3,3,2,3,3,2,2,2,3,2,2,3,2,4,3,2,2,2,2,2,4,1,3,3,4,0,2,3,1,3,3,1,4,1,1,
2,4,2,1,3,3,2,1,3,1,3,2,1,3,2,2,3,4,2,1,2,2,0,1,3,2,4,2,2,0,2,3,1,2,2,2,1,3,1,2,2,2,
2,1,2,2,2,2,2,1,3,3,0,2,3,2,1,1,3,1,4,2,3,4,1,4,2,1,3,4,2,2,2,2,1,1,3,1,4,1,4,0

A115231:
149,331,373,509,701,757,809,877,907,997,1019,1087,1259,1549,1597,1619,1657,1759,1777,1783,1867,1973,2293,
2377,2503,2579,2683,2789,2843,2879,2909,2999,3119,3163,3181,3187,3299,3343,3433,3539,3643,3697,3739,3779,
3877,3967,4001,4013,4153,4229,4271

A115232:
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,
137,139,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,
277,281,283,293,307,311,313,317,337,347,349,353,359,367,379,383,389,397,401,409,419,421,431,433,439,
443,449,457,461,463,467,479,487,491,499,503,521,523,541,547,557,563,569,571,577,587,593,599,601,607,
613,617,619,631,641,643,647,653,659,661,673,677,683

A115233:
2,3,127,163,179,191,193,223,239,251,269,311,337,389,419,431,457,491,547,557,569,599,613,653,659,673,683,
719,739,787,821,839,853,883,911,929,953,967,977,1117,1123,1201,1229,1249,1283,1289,1297,1303,1327,1381,
1409,1423,1439,1451,1471,1481,1499,1607,1663,1693,1721,1723,1747,1801,1861,1871,1889,1901,1907,1979,1987,
1993,2017,2027,2039,2053,2069,2081,2099,2111,2203,2287,2333,2339,2347,2381,2411,2423,2459,2473

isA061345 := proc(q)
local pw ;
if q = 1 then
true;
elif q <= 0 then
false ;
else
pw := ifactors(q)[2] ;
if nops(pw) = 1 then
if op(1,op(1,pw)) > 2 then
true;
else
false;
end if;
else
false;
end if;
end if;
end proc:
A000079 := proc(n)
2^n ;
end proc:

A115230 := proc(n)
local a,p,k ;
a := 0 ;
p := ithprime(n) ;
for k from 0 do
if A000079(k) > p then
break ;
elif isA061345(p-A000079(k)) then
a := a+1 ;
end if;
end do:
a ;
end proc:
A115231 := proc(n)
local k ;
if n = 1 then
149 ;
else
for k from numtheory[pi](procname(n-1))+1 do
if A115230(k) = 0 then
return ithprime(k) ;
end if;
end do;
end if:
end proc:
A115232 := proc(n)
local k ;
if n = 1 then
2 ;
else
for k from numtheory[pi](procname(n-1))+1 do
if A115230(k) > 0 then
return ithprime(k) ;
end if;
end do;
end if:
end proc:
A115233 := proc(n)
local k ;
if n = 1 then
2 ;
else
for k from numtheory[pi](procname(n-1))+1 do
if A115230(k) = 1 then
return ithprime(k) ;
end if;
end do;
end if:
end proc:
seq(A115230(n),n=1..126) ;
seq(A115231(n),n=1..60) ;
seq(A115232(n),n=1..120) ;
seq(A115233(n),n=1..90) ;

```