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.

A355633 a(n) is the sum of the divisors of n whose binary expansions appear as substrings in the binary expansion of n.

This page as a plain text file.
%I A355633 #17 Jul 16 2022 07:18:04
%S A355633 1,3,4,7,6,12,8,15,10,18,12,28,14,24,19,31,18,30,20,42,22,36,24,60,26,
%T A355633 42,31,56,30,57,32,63,34,54,36,70,38,60,43,90,42,66,44,84,54,72,48,
%U A355633 124,50,78,55,98,54,93,72,120,61,90,60,133,62,96,74,127,66
%N A355633 a(n) is the sum of the divisors of n whose binary expansions appear as substrings in the binary expansion of n.
%H A355633 Rémy Sigrist, <a href="/A355633/b355633.txt">Table of n, a(n) for n = 1..10000</a>
%H A355633 Rémy Sigrist, <a href="/A355633/a355633.png">Colored scatterplot of the first 100000 terms</a> (the color is function of the 2-adic valuation of n)
%H A355633 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H A355633 <a href="/index/Di#divisors">Index entries for sequences related to divisors</a>
%F A355633 a(n) <= A000203(n).
%F A355633 a(2^n) = 2^(n+1) - 1 for any n >= 0.
%e A355633 For n = 84:
%e A355633 - the binary expansion of 84 is "1010100",
%e A355633 - we have the following divisors:
%e A355633   d   bin(d)   in bin(84)?
%e A355633   --  -------  -----------
%e A355633    1        1  Yes
%e A355633    2       10  Yes
%e A355633    3       11  No
%e A355633    4      100  Yes
%e A355633    6      110  No
%e A355633    7      111  No
%e A355633   12     1100  No
%e A355633   14     1110  No
%e A355633   21    10101  Yes
%e A355633   28    11100  No
%e A355633   42   101010  Yes
%e A355633   84  1010100  Yes
%e A355633 - so a(84) = 1 + 2 + 4 + 21 + 42 + 84 = 154.
%t A355633 a[n_] := DivisorSum[n, # &, StringContainsQ @@ IntegerString[{n, #}, 2] &]; Array[a, 100] (* _Amiram Eldar_, Jul 16 2022 *)
%o A355633 (PARI) a(n, base=2) = { my (d=digits(n, base), s=setbinop((i, j) -> fromdigits(d[i..j], base), [1..#d]), v=0); for (k=1, #s, if (s[k] && n%s[k]==0, v+=s[k])); return (v) }
%o A355633 (Python)
%o A355633 from sympy import divisors
%o A355633 def a(n):
%o A355633     s = bin(n)[2:]
%o A355633     return sum(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
%o A355633 print([a(n) for n in range(1, 66)]) # _Michael S. Branicky_, Jul 11 2022
%Y A355633 Cf. A000203, A027750, A093640, A355620 (decimal analog), A355634.
%K A355633 nonn,base
%O A355633 1,2
%A A355633 _Rémy Sigrist_, Jul 11 2022