login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


a(1)=2 then a(n)=a(n-1)+3 if n is already in the sequence, a(n)=a(n-2)+1 otherwise.
0

%I #3 Mar 30 2012 18:39:24

%S 2,5,3,6,9,12,10,13,16,19,17,20,23,21,24,27,30,28,31,34,37,35,38,41,

%T 39,42,45,48,46,49,52,50,53,56,59,57,60,63,66,64,67,70,68,71,74,77,75,

%U 78,81,84,82,85,88,86,89,92,95,93,96,99,97,100,103,106,104,107,110,113,111

%N a(1)=2 then a(n)=a(n-1)+3 if n is already in the sequence, a(n)=a(n-2)+1 otherwise.

%F a(n)=phi*n+O(1) where phi=(1+sqrt(5))/2

%o (PARI) an=vector(100);a(n)=if(n<0,0,an[n]);an[1]=2;for(n=2,100,an[n]=if(setsearch(Set(vector(n-1,i,a(i))),n),a(n-1)+3,a(n-2)+1))

%K nonn

%O 1,1

%A _Benoit Cloitre_, Oct 24 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 02:02 EDT 2024. Contains 376090 sequences. (Running on oeis4.)