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.

A026491 a(n) = least k > a(n-1) such that A001285(k-1) = A001285(n-1) for n >= 1.

This page as a plain text file.
%I A026491 #22 Sep 16 2022 07:34:26
%S A026491 1,4,5,8,10,12,13,16,17,20,21,24,26,28,29,32,34,36,37,40,42,44,45,48,
%T A026491 49,52,53,56,58,60,61,64,65,68,69,72,74,76,77,80,81,84,85,88,90,92,93,
%U A026491 96,98,100,101,104,106,108,109,112,113,116,117
%N A026491 a(n) = least k > a(n-1) such that A001285(k-1) = A001285(n-1) for n >= 1.
%H A026491 Robert Israel, <a href="/A026491/b026491.txt">Table of n, a(n) for n = 0..10000</a>
%F A026491 a(n+1)-a(n) = A171900(n+2) for n>=1. - _Michel Dekking_, Apr 11 2019
%p A026491 N:= 200: # for terms <= N
%p A026491 S:= StringTools:-ThueMorse(N):
%p A026491 R:= 1: r:= 1:
%p A026491 for n from 1 do
%p A026491   j:= SearchText(S[n],S,r+1..-1);
%p A026491   if j = 0 then break fi;
%p A026491   R:= R, r+j;
%p A026491   r:= r+j;
%p A026491   if r >= N then break fi;
%p A026491 od:
%p A026491 R; # _Robert Israel_, Apr 11 2019
%p A026491 # alternative
%p A026491 A026491 := proc(n)
%p A026491     option remember ;
%p A026491     local f,k ;
%p A026491     if n = 0 then
%p A026491         1;
%p A026491     else
%p A026491         f := A001285(n-1) ;
%p A026491         for k from procname(n-1)+1 do
%p A026491             if A001285(k-1) = f then
%p A026491                 return k;
%p A026491             end if;
%p A026491         end do:
%p A026491     end if;
%p A026491 end proc:
%p A026491 seq(A026491(n),n=0..40) ; # _R. J. Mathar_, Jun 24 2021
%t A026491 a[n_] := a[n] = If[n==0, 1, For[k = a[n-1]+1, True, k++, If[ThueMorse[k-1]==ThueMorse[n-1], Return[k]]]];
%t A026491 Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Sep 16 2022 *)
%Y A026491 Cf. A001285, A171900.
%K A026491 nonn
%O A026491 0,2
%A A026491 _Clark Kimberling_
%E A026491 Clarified NAME with respect to A001285 offsets. - _R. J. Mathar_, Jun 24 2021