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.

A387407 Partial sums of A387422, where A387422 is the length of the maximal common prefix of the binary expansions of n and sigma(n).

This page as a plain text file.
%I A387407 #7 Sep 03 2025 13:11:09
%S A387407 1,2,3,4,5,8,9,10,11,13,14,16,18,20,22,23,26,30,32,36,38,40,41,43,45,
%T A387407 46,47,52,55,56,57,58,59,60,61,63,67,68,69,72,76,77,80,83,85,87,88,90,
%U A387407 92,93,94,97,101,103,104,107,108,109,112,113,117,119,121,122,124,127,131,132,133,136,139,140,145,146,147
%N A387407 Partial sums of A387422, where A387422 is the length of the maximal common prefix of the binary expansions of n and sigma(n).
%H A387407 Antti Karttunen, <a href="/A387407/b387407.txt">Table of n, a(n) for n = 1..65537</a>
%H A387407 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>.
%H A387407 <a href="/index/Si#SIGMAN">Index entries for sequences related to sigma(n)</a>.
%F A387407 a(1) = 1; and for n > 1, a(n) = a(n-1) + A387422(n).
%F A387407 a(n) = A387408(n) + A387409(n).
%o A387407 (PARI)
%o A387407 up_to = 65537;
%o A387407 A387422(n) = { my(a=binary(n), b=binary(sigma(n)), i=1); while(i<=#a,if(a[i]!=b[i],return(i-1)); i++); (#a); };
%o A387407 A387407list(up_to) = { my(v=vector(up_to)); v[1] = A387422(1); for(n=2,up_to,v[n] = v[n-1]+A387422(n)); (v); };
%o A387407 v387407 = A387407list(up_to);
%o A387407 A387407(n) = v387407[n];
%Y A387407 Cf. A003961, A387422, A387408, A387409.
%Y A387407 Cf. also A387424.
%K A387407 nonn,new
%O A387407 1,2
%A A387407 _Antti Karttunen_, Sep 03 2025