login
a(1)=1 and a(n+1) = Sum_{k=1..n} b(n,a(k)), where b(n,a(k)) is the largest positive integer that, when written in binary, occurs as a substring in both binary n and binary a(k).
1

%I #22 Dec 29 2023 13:57:39

%S 1,1,2,3,5,10,11,11,13,15,36,49,42,56,54,47,42,53,52,57,112,129,131,

%T 136,163,137,183,196,198,192,162,109,218,172,275,273,151,213,196,181,

%U 343,285,367,395,437,549,389,403,524,645,409,418,568,632,608,587,719,576,570,599,565,533,393,255,595,569,565,494,984,819

%N a(1)=1 and a(n+1) = Sum_{k=1..n} b(n,a(k)), where b(n,a(k)) is the largest positive integer that, when written in binary, occurs as a substring in both binary n and binary a(k).

%H John Tyler Rascoe, <a href="/A175481/b175481.txt">Table of n, a(n) for n = 1..2048</a>

%o (Python)

%o from itertools import count

%o def b(n,ak):

%o for x in count(0):

%o bx = bin(min(n,ak)-x)[2:]

%o if bx in bin(n)[2:] and bx in bin(ak)[2:]:

%o return(int(bx,2)); break

%o def A175481_list(nmax):

%o A = [1]

%o for n in range(2,nmax+1):

%o A.append((sum(b(n-1,A[k-1]) for k in range(1,n))))

%o return(A) # _John Tyler Rascoe_, Dec 29 2023

%K base,nonn

%O 1,3

%A _Leroy Quet_, May 26 2010

%E More terms from _Sean A. Irvine_, Mar 02 2011