cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A161165 The n-th twin prime plus the n-th isolated prime.

Original entry on oeis.org

5, 28, 44, 58, 66, 84, 98, 112, 120, 138, 156, 186, 192, 228, 236, 268, 276, 318, 332, 370, 390, 406, 414, 456, 474, 498, 510, 528, 536, 580, 588, 606, 614, 648, 654, 670, 680, 712, 722, 786, 792, 868, 878, 898, 912, 948, 954, 1020, 1026, 1078, 1112, 1146, 1158, 1180
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 04 2009

Keywords

Examples

			a(1) = 3 +  2 =  5;
a(2) = 5 + 23 = 28;
a(3) = 7 + 37 = 44.
		

Crossrefs

Programs

  • 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:
    A161165 := proc(n) A001097(n) + A007510(n) ; 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

Formula

a(n) = A001097(n) + A007510(n).

Extensions

Entries checked by R. J. Mathar, Mar 18 2010