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.

Showing 1-5 of 5 results.

A093653 Total number of 1's in binary expansion of all divisors of n.

Original entry on oeis.org

1, 2, 3, 3, 3, 6, 4, 4, 5, 6, 4, 9, 4, 8, 9, 5, 3, 10, 4, 9, 9, 8, 5, 12, 6, 8, 9, 12, 5, 18, 6, 6, 8, 6, 9, 15, 4, 8, 10, 12, 4, 18, 5, 12, 15, 10, 6, 15, 7, 12, 9, 12, 5, 18, 11, 16, 10, 10, 6, 27, 6, 12, 17, 7, 8, 16, 4, 9, 10, 18, 5, 20, 4, 8, 16, 12, 11, 20, 6, 15, 12, 8, 5, 27, 9, 10, 12
Offset: 1

Views

Author

Jason Earls, May 16 2004

Keywords

Examples

			a(8) = 4 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so four 1's.
		

Crossrefs

Cf. A226590 (number of 0's in binary expansion of all divisors of n).
Cf. A182627 (number of digits in binary expansion of all divisors of n).
Cf. A034690 (a decimal equivalent).

Programs

  • Maple
    a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 17 2022
  • Mathematica
    Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* Alonso del Arte, Sep 01 2013 *)
  • PARI
    A093653(n) = sumdiv(n,d,hammingweight(d)); \\ Antti Karttunen, Dec 14 2017
    
  • PARI
    a(n) = {my(v = valuation(n, 2), n = (n>>v)); sumdiv(n, d, hammingweight(d)) * (v + 1)} \\ David A. Corneth, Feb 15 2023
    
  • Python
    from sympy import divisors
    def a(n): return sum(bin(d).count("1") for d in divisors(n))
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Apr 20 2022
    
  • Python
    from sympy import divisors
    def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True))
    print([A093653(n) for n in range(1, 88)]) # Michael S. Branicky, Feb 15 2023

Formula

a(n) = Sum_{k = 0..n} if(mod(n, k) = 0, A000120(k), 0). - Paul Barry, Jan 14 2005
a(n) = A182627(n) - A226590(n). - Jaroslav Krizek, Sep 01 2013
a(n) = A292257(n) + A000120(n). - Antti Karttunen, Dec 14 2017
From Bernard Schott, May 16 2022: (Start)
If prime p = A000043(n), then a(2^p-1) = a(A000668(n)) = p+1 = A050475(n).
a(2^n) = n+1 (End)

A182622 a(n) is the number whose binary representation is the concatenation of the divisors of n written in base 2.

Original entry on oeis.org

1, 6, 7, 52, 13, 222, 15, 840, 121, 858, 27, 28268, 29, 894, 991, 26896, 49, 113970, 51, 215892, 2037, 3446, 55, 14471576, 441, 3514, 3899, 217052, 61, 14538238, 63, 1721376, 7905, 13410, 7139, 926213284, 101, 13542, 8039, 221009192
Offset: 1

Views

Author

Omar E. Pol, Nov 22 2010

Keywords

Comments

a(n) is A182621(n), interpreted as a binary number, written in base 10. The first repeated element is 991, from 15 and 479.
Except for 1, no power of 2 can occur in this sequence, an obvious consequence of the fact that a(n) has to be the sum of at least two distinct powers of 2 for all n > 1. - Alonso del Arte, Nov 13 2013

Examples

			The divisors of 10 are 1, 2, 5, 10. Then 1, 2, 5, 10 written in base 2 are 1, 10, 101, 1010. The concatenation of 1, 10, 101, 1010 is 1101011010. Then a(10) = 858 because the binary number 1101011010 written in base 10 is 858.
		

Crossrefs

Programs

  • Mathematica
    concatBits[n_] := FromDigits[Join @@ (IntegerDigits[#, 2]& /@ Divisors[n]), 2]; concatBits /@ Range[40](* Giovanni Resta, Nov 23 2010 *)
  • PARI
    a(n) = {my(cbd = []); fordiv(n, d, cbd = concat(cbd, binary(d));); fromdigits(cbd, 2);} \\ Michel Marcus, Jan 28 2017
  • Python
    def A182622(n):
        s=""
        for i in range(1,n+1):
            if n%i==0:
                s+=bin(i)[2:]
        return int(s,2) # Indranil Ghosh, Jan 28 2017
    

Formula

a(p) = 2^(floor(log_2(p)) + 1) + p for p prime. Also, a(p + k) > a(p) for all k > 0. Furthermore, for all primes p > 3, a(p) < a(p - 1).
a(2^(m - 1)) = sum(k = 0 .. m - 1, 2^((m^2 + m)/2 - (k^2 + k)/2 - 1)) = A164894(m). - Alonso del Arte, Nov 13 2013

Extensions

More terms from Giovanni Resta, Nov 23 2010

A226590 Total number of 0's in binary expansion of all divisors of n.

Original entry on oeis.org

0, 1, 0, 3, 1, 2, 0, 6, 2, 4, 1, 6, 1, 2, 1, 10, 3, 7, 2, 9, 2, 4, 1, 12, 3, 4, 3, 6, 1, 6, 0, 15, 5, 8, 4, 15, 3, 6, 3, 16, 3, 8, 2, 9, 5, 4, 1, 20, 3, 9, 5, 9, 2, 10, 3, 12, 4, 4, 1, 15, 1, 2, 4, 21, 7, 14, 4, 15, 5, 12, 3, 26, 4, 8, 6, 12, 4, 10, 2, 25, 7
Offset: 1

Views

Author

Jaroslav Krizek, Aug 31 2013

Keywords

Comments

Also total number of 0's in binary expansion of concatenation of the binary numbers that are the divisors of n written in base 2 (A182621).
a(n) = 0 iff n = 1 or n is a Mersenne prime (A000668). - Bernard Schott, Apr 22 2022

Examples

			a(8) = 6 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so six 0's.
		

Crossrefs

Cf. A093653 (number of 1's in binary expansion of all divisors of n).
Cf. A182627 (number of digits in binary expansion of all divisors of n).
Cf. A182621 (concatenation of the divisors of n written in base 2).

Programs

  • Mathematica
    Table[Count[Flatten[IntegerDigits[Divisors[n], 2]], 0], {n, 81}] (* T. D. Noe, Sep 04 2013 *)
  • PARI
    a(n) = sumdiv(n, d, 1+logint(d, 2) - hammingweight(d)); \\ Michel Marcus, Apr 24 2022
  • Python
    from sympy import divisors
    def a(n): return sum(bin(d)[2:].count("0") for d in divisors(n))
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Apr 20 2022
    

Formula

a(n) = A182627(n) - A093653(n).
a(2^n) = n*(n+1)/2 = A000217(n). - Bernard Schott, Apr 22 2022

A182628 Triangle T(n,k) read by rows in which row n lists the number of digits of the binary expansion of the divisors of n.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 3, 4, 1, 2, 4, 1, 2, 3, 4, 1, 4, 1, 2, 2, 3, 3, 4, 1, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 5, 1, 2, 2, 3, 4, 5, 1, 5, 1, 2, 3, 3, 4, 5, 1, 2, 3, 5, 1, 2, 4, 5, 1, 5, 1, 2, 2
Offset: 1

Views

Author

Omar E. Pol, Nov 23 2010

Keywords

Comments

Row n lists the number of digits of the numbers in the n-th row of triangle A182620.

Examples

			Triangle begins:
1,
1, 2,
1, 2,
1, 2, 3,
1, 3,
1, 2, 2, 3,
1, 3,
1, 2, 3, 4,
1, 2, 4,
1, 2, 3, 4,
1, 4,
1, 2, 2, 3, 3, 4,
		

Crossrefs

Row sums give A182627.

Programs

  • Maple
    with(numtheory):for n from 1 to 12 do for d in divisors(n) do printf("%d, ",length(convert(convert(d, binary),string))); od:printf("\n"); od: # Nathaniel Johnston, Apr 19 2011

Extensions

a(38)-a(79) from Nathaniel Johnston, Apr 19 2011

A231116 Numbers k such that the total number of digits of all the divisors of k written in base 2 is equal to k.

Original entry on oeis.org

1, 3, 10, 24
Offset: 1

Views

Author

Jaroslav Krizek, Nov 03 2013

Keywords

Comments

Sequence is finite with 4 terms.
Numbers k such that the concatenation of their divisors written in base 2 contains k digits.
Subsequence of finite sequence: 1, 2, 3, 4, 6, 8, 10, 12, 24 (numbers k such that the total number of digits of all the divisors of k written in base 2 is greater than or equal to k).
Numbers k such that A182627(k) = k.

Examples

			24 is in the sequence because the concatenation of the divisors of 24 in base 2 [(1, 10, 11, 100, 110, 1000, 1100, 11000) -> 110111001101000110011000] contains 24 digits.
		

Crossrefs

Showing 1-5 of 5 results.