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.

Previous Showing 11-20 of 37 results. Next

A083567 Let B(k) be the number of binary digits in k equal to 1. This is the sequence of positive integers k such that 2B(k)=B(k^2).

Original entry on oeis.org

21, 37, 42, 45, 53, 69, 73, 74, 81, 83, 84, 90, 106, 133, 137, 138, 141, 146, 148, 155, 161, 162, 165, 166, 168, 177, 180, 211, 212, 261, 265, 266, 269, 273, 274, 276, 281, 282, 289, 291, 292, 295, 296, 299, 310, 321, 322, 324, 330, 332, 336, 354, 359, 360
Offset: 1

Views

Author

Giuseppe Melfi, Jun 13 2003

Keywords

Comments

This includes all k > 1 such that the average of ones in the binary expansion of k is the same of the average of ones in binary expansion of k^2; these are the values in the sequence with sqrt(2)*2^j < a(k) < 2^(j+1) for some j. - Corrected by Franklin T. Adams-Watters, Aug 23 2012
Conjecture: The counting function p(n) satisfies p(n)=c n/log n + o(n/log n).

Examples

			21 is in the sequence because 21=10101_2 (3 1's) and 441=110111001_2 (6 1's).
		

Crossrefs

Programs

  • Maple
    select(t -> 2*convert(convert(t,base,2),`+`) = convert(convert(t^2,base,2),`+`), [$1..1000]); # Robert Israel, Aug 27 2015
  • Mathematica
    f[n_] := Total@ IntegerDigits[n, 2]; Select[Range@ 360, 2 f@ # == f[#^2] &] (* Michael De Vlieger, Aug 27 2015 *)
  • PARI
    isok(n) =  norml2(binary(n^2)) == 2*norml2(binary(n)) \\ Michel Marcus, Jun 20 2013

A192085 Number of ones in the binary expansion of n^3.

Original entry on oeis.org

0, 1, 1, 4, 1, 6, 4, 6, 1, 6, 6, 6, 4, 5, 6, 8, 1, 6, 6, 8, 6, 6, 6, 9, 4, 7, 5, 8, 6, 9, 8, 10, 1, 6, 6, 11, 6, 10, 8, 12, 6, 8, 6, 9, 6, 11, 9, 10, 4, 9, 7, 7, 5, 8, 8, 10, 6, 10, 9, 7, 8, 11, 10, 12, 1, 6, 6, 11, 6, 9, 11, 11, 6, 13, 10, 14, 8, 13, 12, 13
Offset: 0

Views

Author

Carl R. White, Jun 23 2011

Keywords

Comments

The binary weight of n^3.

Crossrefs

Programs

Formula

a(n) = A000120(A000578(n)).
a(n) = [x^(n^3)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018

A235001 Odious squares.

Original entry on oeis.org

1, 4, 16, 25, 49, 64, 81, 100, 121, 196, 256, 289, 324, 361, 400, 484, 529, 625, 784, 841, 961, 1024, 1089, 1156, 1225, 1296, 1444, 1521, 1600, 1681, 1849, 1936, 2116, 2401, 2500, 2601, 3025, 3136, 3364, 3481, 3844, 4096, 4225, 4356, 4489, 4624, 4900, 5041, 5184, 5625
Offset: 1

Views

Author

Gerasimov Sergey, Jan 02 2014

Keywords

Comments

This sequence is the intersection of A000069 and A000290. Numbers n^2 such that A159918 is odd.

Examples

			16 is a square 4^2 and 16 in base 2 is a 10000, having an odd number of 1's, thus 16 is in this sequence.
		

Crossrefs

Cf. A231431 (evil squares).

Programs

  • Mathematica
    Select[Range[200]^2,OddQ[DigitCount[#,2,1]]&] (* Harvey P. Dale, Jan 14 2014 *)

A231431 Evil squares.

Original entry on oeis.org

0, 9, 36, 144, 169, 225, 441, 576, 676, 729, 900, 1369, 1764, 2025, 2209, 2304, 2704, 2809, 2916, 3249, 3600, 3721, 3969, 4761, 5329, 5476, 6561, 6889, 7056, 8100, 8649, 8836, 9216, 9801, 10816, 11025, 11236, 11449, 11664, 11881, 12321, 12996, 13225, 14161, 14400, 14884, 15129, 15876, 17689, 18769, 19044, 19881, 21316, 21904
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 20 2013

Keywords

Comments

Numbers n^2 such that A159918(n) is even.
Intersection of A000290 and A001969.

Examples

			36 is in the sequence because 36 = 6^2 and 36 in base 2 is 100100, having an even number of 1's.
		

Crossrefs

Programs

Formula

Conjecture: a(n) ~ 4n^2. - Charles R Greathouse IV, Nov 20 2013

Extensions

Corrected and extended by Harvey P. Dale, Nov 23 2015

A214560 Number of 0's in binary expansion of n^2.

Original entry on oeis.org

1, 0, 2, 2, 4, 2, 4, 3, 6, 4, 4, 2, 6, 4, 5, 4, 8, 6, 6, 4, 6, 3, 4, 7, 8, 5, 6, 4, 7, 5, 6, 5, 10, 8, 8, 6, 8, 5, 6, 4, 8, 6, 5, 4, 6, 3, 9, 8, 10, 7, 7, 7, 8, 4, 6, 5, 9, 6, 7, 5, 8, 6, 7, 6, 12, 10, 10, 8, 10, 7, 8, 6, 10, 7, 7, 4, 8, 6, 6, 8, 10, 7, 8, 5, 7
Offset: 0

Views

Author

Alex Ratushnyak, Jul 21 2012

Keywords

Comments

Conjecture: for every x>=0 there is an i such that a(n)>x for n>i.
Comment from N. J. A. Sloane, Nov 21 2013: See also the conjecture in A231898.

Crossrefs

Programs

  • Haskell
    a214560 = a023416 . a000290  -- Reinhard Zumkeller, Nov 20 2013
    
  • Maple
    A214560 := proc(n)
        A023416(n^2) ;
    end proc: # R. J. Mathar, Jul 21 2012
    # second Maple program:
    a:= n-> `if`(n=0, 1, add(1-i, i=Bits[Split](n^2))):
    seq(a(n), n=0..84);  # Alois P. Heinz, Nov 25 2024
  • Mathematica
    Join[{1},Table[DigitCount[n^2,2,0],{n,100}]] (* Harvey P. Dale, Nov 24 2024 *)
  • PARI
    vector(66,n,b=binary((n-1)^2);sum(j=1,#b,1-b[j])) /* Joerg Arndt, Jul 21 2012 */
    
  • Python
    for n in range(300):
        b = n*n
        c = 0
        while b>0:
            c += 1-(b&1)
            b//=2
        print(c+(n==0), end=', ')
    
  • Python
    def A214560(n):
        return bin(n*n)[2:].count('0') # Chai Wah Wu, Sep 03 2014

Formula

a(n) = A023416(A000290(n)).

A231898 a(n) = smallest k with property that for all m >= k, there is a square N^2 whose binary expansion contains exactly n 1's and m 0's; or -1 if no such k exists.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 19 2013

Keywords

Comments

a(n) = -1 for n = 1, 2 and 4, because all squares with exactly 1, 2 or 4 1's in their binary expansion must contain an even number of 0's.
Conjecture: Apart from n=1, 2 and 4, no other a(n) is -1.
See A214560 for a related conjecture.

Examples

			Here is a table whose columns give:
N, N^2, number of bits in N^2, number of 1's in N^2, number of 0's in N^2:
0 0 1 0 1
1 1 1 1 0
2 4 3 1 2
3 9 4 2 2
4 16 5 1 4
5 25 5 3 2
6 36 6 2 4
7 49 6 3 3
8 64 7 1 6
9 81 7 3 4
10 100 7 3 4
11 121 7 5 2
12 144 8 2 6
13 169 8 4 4
14 196 8 3 5
15 225 8 4 4
16 256 9 1 8
17 289 9 3 6
18 324 9 3 6
19 361 9 5 4
...
a(n) is defined by the property that for all m >= a(n), the table contains a row ending n m. For example, there are rows ending 3 2, 3 3, 3 4, 3 5, ..., but not 3 1, so a(3) = 2.
a(5)=4: for t>=0, (11*2^t)^2 contains 5 1's and 2t+2 0's and (25*2^t)^2 contains 5 1's and 2t+5 0's, so for m >= 4 there is a number N such that N^2 contains 5 1's and m 0's. Also 4 is the smallest number with this property, so a(5) = 4.
		

Crossrefs

Extensions

Missing word in definition supplied by Jon Perry, Nov 20 2013.

A357304 Records of the Hamming weight of squares.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 87, 88, 89
Offset: 1

Views

Author

Hugo Pfoertner, Oct 01 2022

Keywords

Examples

			a(70) = 77 corresponds to A230097(70) = 34895284158283. Its square 1217680856487316499797508089 is the smallest and the only 90-bit square with this Hamming weight.
		

Crossrefs

A230097 gives the values of k such that A000120(k^2) sets a new record.

Extensions

Missing a(68)=75 and a(71)-a(80) from Bert Dobbelaere, Nov 20 2022

A286374 a(n) = A278222(n^2).

Original entry on oeis.org

1, 2, 2, 6, 2, 12, 6, 12, 2, 30, 12, 48, 6, 210, 12, 24, 2, 30, 30, 420, 12, 360, 48, 30, 6, 120, 210, 1260, 12, 420, 24, 48, 2, 30, 30, 420, 30, 4620, 420, 480, 12, 420, 360, 1080, 48, 960, 30, 210, 6, 420, 120, 2310, 210, 3360, 1260, 1680, 12, 1260, 420, 6300, 24, 840, 48, 96, 2, 30, 30, 420, 30, 4620, 420, 2520, 30, 4620, 4620, 6720, 420, 9240, 480, 180
Offset: 0

Views

Author

Antti Karttunen, May 09 2017

Keywords

Crossrefs

Cf. A159918 (one of the matched sequences).

Programs

  • Python
    from sympy import prime, factorint
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a278222(n): return a046523(a005940(n + 1))
    def a(n): return a278222(n**2) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286374 n) (A278222 (* n n)))
    

Formula

a(n) = A278222(A000290(n)) = A278222(n^2).

A352084 Integers m such that wt(m) divides wt(m^2) where wt(m) = A000120(m) is the binary weight of m.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 21, 24, 28, 30, 31, 32, 37, 42, 45, 48, 53, 56, 60, 62, 63, 64, 69, 73, 74, 79, 81, 83, 84, 90, 91, 96, 106, 112, 120, 124, 126, 127, 128, 133, 137, 138, 141, 146, 148, 155, 157, 158, 159, 161, 162, 165, 166, 168, 177, 180
Offset: 1

Views

Author

Bernard Schott, Mar 03 2022

Keywords

Comments

Integers m such that A000120(m) divides A159918(m).
This is a problem proposed by the French site Diophante in the links section.
The first 18 terms are the same as A268415, then A268415(19) = 41 while a(19) = 42.
The corresponding quotients are in A352085.
The smallest term k such that the corresponding quotient = n is A352086(n).
Some subsequences:
-> wt(m^2) = wt(m) iff m is in A077436.
-> wt(m^2) / wt(m) = 2 iff m is in A083567.
-> When m is a power of 2 (A000079): wt(2^k) = wt((2^k)^2) = wt(2^(2k)) = 1.

Examples

			37_10 = 100101_2, digsum_2(37) = 1+1+1 = 3; then 37^2 = 1369_10 = 10101011001_2, digsum_2(1369) = 1+1+1+1+1+1 = 6; as 3 divides 6, 37 is a term.
		

Crossrefs

Cf. A351650 (similar for base 10).
Subsequences: A000079, A023758, A077436, A083567.

Programs

  • Mathematica
    Select[Range[180], Divisible[Total[IntegerDigits[#^2, 2]], Total[IntegerDigits[#, 2]]] &] (* Amiram Eldar, Mar 03 2022 *)
  • PARI
    isok(m) = !(hammingweight(m^2) % hammingweight(m)); \\ Michel Marcus, Mar 03 2022
  • Python
    def ok(n): return n > 0 and bin(n**2).count('1')%bin(n).count('1') == 0
    print([m for m in range(1, 200) if ok(m)]) # Michael S. Branicky, Mar 03 2022
    

Extensions

More terms from Amiram Eldar, Mar 03 2022

A352085 a(n) is the quotient wt(m^2) / wt(m), where wt = binary weight = A000120 and m = A352084(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Bernard Schott, Mar 05 2022

Keywords

Comments

All positive integers are terms of this sequence and the smallest integer k such that a(k) = n is A352086(n).
a(n) = 1 iff m = A352084(n) is a term of A077436, and a(n) = 2 iff m = A352084(n) is a term of A083567.

Examples

			For n=19, A352084(19) = 42_10 = 101010_2 => wt(42) = 3 ones; then 42^2 = 1764_10 = 11011100100_2 => wt(1764) = 6 ones, so that a(19) = wt(42^2) / wt(42) = 6/3 = 2.
		

Crossrefs

Programs

  • Mathematica
    Select[Total[IntegerDigits[#^2, 2]]/Total[IntegerDigits[#, 2]] & /@ Range[300], IntegerQ] (* Amiram Eldar, Mar 05 2022 *)
  • PARI
    lista(nn) = my(list = List(), q); for (n=1, nn, if (denominator(q=hammingweight(n^2)/hammingweight(n)) == 1, listput(list, q));); Vec(list); \\ Michel Marcus, Mar 05 2022
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        for m in count(1):
            q, r = divmod(bin(m**2).count('1'), bin(m).count('1'))
            if r == 0:
                yield q
    print(list(islice(agen(), 100))) # Michael S. Branicky, Mar 05 2022

Formula

a(n) = A159918(A352084(n))/A000120(A352084(n)).

Extensions

More terms from Michel Marcus, Mar 05 2022
Previous Showing 11-20 of 37 results. Next