OFFSET
1,1
EXAMPLE
a(1) = 3 + 2 = 5;
a(2) = 5 + 23 = 28;
a(3) = 7 + 37 = 44.
MAPLE
isA001097 := proc(n) isprime(n) and (isprime(n+2) or isprime(n-2)) ; end proc:
A001097 := proc(n) if n = 1 then 3; else for p from procname(n-1)+2 by 2 do if isA001097(p) then return p end if; end do: end if; end proc:
isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; end proc:
A007510 := proc(n) if n = 1 then 2; else for p from procname(n-1)+1 do if isA007510(p) then return p end if; end do: end if; end proc:
seq(A161165(n), n=1..100) ; # R. J. Mathar, Mar 18 2010
# alternate program
isA001097 := proc(n) if isprime(n) then isprime(n+2) or isprime(n-2) ; else false; end if; end proc:
isA007510 := proc(n) if isprime(n) then not isprime(n+2) and not isprime(n-2) ; else false; end if; end proc:
A001097 := proc(n) option remember; if n = 1 then 3; else for a from procname(n-1)+1 do if isA001097(a) then return a; end if; end do: end if; end proc:
A007510 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA007510(a) then return a; end if; end do: end if; end proc:
A161165 := proc(n) A001097(n)+A007510(n) ; end proc: seq(A161165(n), n=1..90) ; # R. J. Mathar, Mar 29 2010
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Jun 04 2009
EXTENSIONS
Entries checked by R. J. Mathar, Mar 18 2010
STATUS
approved