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).

Original entry on oeis.org

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, 46, 48, 50, 53, 55, 56, 57, 62, 63, 66, 67, 69, 72, 74, 77, 81, 85, 88, 89, 92, 95, 96, 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
Offset: 1

Views

Author

Antti Karttunen, Sep 03 2025

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    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); };
    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); };
    v387408 = A387408list(up_to);
    A387408(n) = v387408[n];

Formula

a(1) = 1; and for n > 1, a(n) = a(n-1) + A387412(n).
a(n) = A387407(n) - A387409(n).