OFFSET
1,2
COMMENTS
The rule "jump over next something" can be changed. A075694 gives the simplest example: "jump over next prime".
LINKS
Matthew House, Table of n, a(n) for n = 1..10000
FORMULA
a(1)=1, a(n) = 2*nextprime(nextprime(a(n-1)))-a(n-1).
EXAMPLE
a(1)=1; next second prime (second smallest larger than a(1))=3; "jump over" it: 3+(3-1)=5; a(2)=5; next second prime (second smallest larger than a(2))=11; "jump over" it: 11+(11-5)=17.
MAPLE
a(1) := 1; a(n)=2*nextprime(nextprime(a(n-1)))-a(n-1);
PROG
(PARI) np(k)=my(m=k+1); while(!isprime(m), m++); m;
first(m)=my(v=vector(m)); v[1]=1; for(i=2, m, v[i]=2*np(np(v[i-1]))-v[i-1]; ); v; /* Anders Hellström, Aug 08 2015 */
(Magma) [n le 1 select 1 else 2*NextPrime(NextPrime(Self(n-1)))-Self(n-1): n in [1..55]]; // Vincenzo Librandi, Aug 09 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Zak Seidov, Sep 26 2002
STATUS
approved