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.

A166160 a(n) = (n-th odd prime + n-th odd nonprime)/2 - 1.

Original entry on oeis.org

1, 6, 10, 15, 18, 21, 25, 28, 33, 37, 42, 45, 48, 51, 57, 61, 64, 70, 73, 76, 81, 84, 89, 94, 97, 100, 105, 109, 113, 121, 124, 128, 130, 136, 139, 144, 148, 153, 157, 161, 163, 171, 173, 177, 179, 187, 195, 198, 201, 204, 210, 212, 218, 222, 228, 234, 236, 240, 243
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 09 2009

Keywords

Crossrefs

Programs

  • Maple
    A065091 := proc(n) ithprime(n+1) ; end proc:
    A014076 := proc(n) if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then return a ; end if; end do: end if; end proc:
    A166160 := proc(n) (A065091(n)+A014076(n))/2-1 ; end proc: seq(A166160(n),n=1..120) ; # R. J. Mathar, May 21 2010
  • Mathematica
    A014076 := Select[Range@250, ! PrimeQ@# && OddQ@# &]; A166160 := Prime[Range[2, 150]]; Table[(A166160[[n]] + A014076[[n]])/2 - 1, {n, 1, 50}] (* G. C. Greubel, Sep 17 2017 *)
    Module[{nn=250,op,onp},op=Prime[Range[2,nn]];onp=Select[Range[1,nn,2],!PrimeQ[#]&];Total[#]/2-1&/@Thread[{Take[op,Length[ onp]],onp}]] (* Harvey P. Dale, Mar 02 2025 *)

Formula

a(n) = A005097(n) + A047845(n), where A005097 U A047845 = A001477.
a(n) = (A065091(n) + A014076(n))/2 - 1.

Extensions

Entries checked by R. J. Mathar, May 21 2010