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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A025512 Index of n-th 2 in A022300. 2

%I #9 Nov 03 2016 01:38:11

%S 3,5,8,11,13,14,16,19,22,23,25,26,28,31,33,34,37,40,41,43,44,46,49,52,

%T 53,55,58,60,61,64,67,68,70,71,73,76,78,79,82,85,87,88,90,91,94,96,97,

%U 99,102,103,105,106,109,112,114,115,117,118,121,123,124,126,129,132,133,135

%N Index of n-th 2 in A022300.

%H Robert Israel, <a href="/A025512/b025512.txt">Table of n, a(n) for n = 1..10000</a>

%p N:= 10^3: # to get all terms <= N

%p B:= Vector(N):

%p B[1..4]:= <1,1,2,1>:

%p m:= 4: t:= 2:

%p for n from 1 while m < N do

%p t:= 3-t;

%p B[m]:= t;

%p if B[n] = 2 and m+1 < N then

%p B[m+1]:= t; m:= m+2

%p else m:= m+1

%p fi

%p od:

%p select(t -> B[t]=2, [$1..N]); # _Robert Israel_, Nov 02 2016

%K nonn

%O 1,1

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | 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 April 16 19:05 EDT 2024. Contains 371751 sequences. (Running on oeis4.)