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.

A193732 Connell-like sequence.

Original entry on oeis.org

1, 3, 4, 6, 8, 9, 11, 13, 15, 17, 18, 20, 22, 24, 26, 28, 30, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 110, 112, 114, 116, 118, 120
Offset: 1

Views

Author

Ctibor O. Zizka, Aug 08 2011

Keywords

Examples

			Let prime(n) denote the n-th prime.
Because prime(1)=2, take first 2 odd numbers giving a(1)=1, a(2)=3.
Because prime(2)=3, take 3 even numbers starting with 4 giving a(3)=4, a(4)=6, a(5)=8.
Because prime(3)=5, take 5 odd numbers starting with 9 giving a(6)=9, a(7)=11, a(8)=13, a(9)=15, a(10)=17.
Because prime(4)=7, take 7 even numbers starting with 18 gives a(11)=18, a(12)=20, ..., a(17)=30 etc.
		

Crossrefs

Programs

  • Maple
    cp:=2:ct:=1:a := proc(n) option remember: global cp,ct: if(n=1)then return 1: elif(ct=cp)then ct:=1:cp:=nextprime(cp): return a(n-1)+1: else ct:=ct+1: return a(n-1)+2: fi: end: seq(a(n),n=1..100); # Nathaniel Johnston, Aug 11 2011
  • Mathematica
    nxt[{p_,a_}]:={NextPrime[p],Range[Last[a]+1,Last[a]+2*NextPrime[p],2]}; Transpose[NestList[nxt,{2,{1,3}},10]][[2]]//Flatten (* Harvey P. Dale, Mar 23 2016 *)