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.

A387408 Partial sums of A387412, where A387412(n) is the length of the maximal common prefix of the binary expansions of n and A003961(n).

This page as a plain text file.
%I A387408 #7 Sep 03 2025 13:11:16
%S A387408 1,2,3,6,7,9,10,11,12,16,17,18,19,20,21,23,26,31,33,34,35,37,38,39,43,
%T A387408 46,48,50,53,55,56,57,62,63,66,67,69,72,74,77,81,85,88,89,92,95,96,
%U A387408 100,102,103,104,105,107,108,109,110,116,117,120,121,122,124,125,127,128,129,133,135,138,139,142,144,148,149
%N A387408 Partial sums of A387412, where A387412(n) is the length of the maximal common prefix of the binary expansions of n and A003961(n).
%H A387408 Antti Karttunen, <a href="/A387408/b387408.txt">Table of n, a(n) for n = 1..65537</a>
%H A387408 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>.
%H A387408 <a href="/index/Pri#prime_indices">Index entries for sequences related to prime indices in the factorization of n</a>.
%F A387408 a(1) = 1; and for n > 1, a(n) = a(n-1) + A387412(n).
%F A387408 a(n) = A387407(n) - A387409(n).
%o A387408 (PARI)
%o A387408 up_to = 65537;
%o A387408 A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
%o A387408 A387412(n) = { my(a=binary(n), b=binary(A003961(n)), i=1); while(i<=#a,if(a[i]!=b[i],return(i-1)); i++); (#a); };
%o A387408 A387408list(up_to) = { my(v=vector(up_to)); v[1] = A387412(1); for(n=2,up_to,v[n] = v[n-1]+A387412(n)); (v); };
%o A387408 v387408 = A387408list(up_to);
%o A387408 A387408(n) = v387408[n];
%Y A387408 Cf. A000203, A387412, A387407, A387409.
%Y A387408 Cf. also A387425.
%K A387408 nonn,base,new
%O A387408 1,2
%A A387408 _Antti Karttunen_, Sep 03 2025