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 28 results. Next

A114391 Positions where A114390 is a square.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 25, 28, 30, 31, 32, 48, 50, 56, 60, 62, 63, 64, 96, 100, 112, 113, 120, 124, 126, 127, 128, 189, 192, 200, 224, 226, 240, 248, 252, 254, 255, 256, 378, 381, 384, 400, 448, 452, 480, 481, 496, 504, 508, 510, 511, 512, 756
Offset: 1

Views

Author

Antti Karttunen, Feb 07 2006

Keywords

Crossrefs

A114392 gives the corresponding values. Differs from A077436 (and A023758) for the first time at n=13, where a(13)=25, while A077436(13)=28. First differences: A114394.

A118655 Numbers k such that Hamming weight of k equals Hamming weight of k^3.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 56953, 65536, 113906, 131072, 227812, 262144, 455624, 524288, 911248, 1048576, 1822496, 1830651, 2097152, 3644992, 3661302, 4194304, 5502457, 7289984, 7322604
Offset: 1

Views

Author

R. J. Mathar, May 18 2006

Keywords

Comments

A000079(n) is a subsequence because the Hamming weight of any A000079(n) is 1 and cubing such a number just adds binary zeros. A077436 is the sequence when the a(n) is squared, not cubed as here.

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], DigitCount[#, 2, 1] == DigitCount[#^3, 2, 1] &] (* Amiram Eldar, Jul 16 2023 *)
  • PARI
    bitcnt(n)= { local(bitv,bitl) ; bitv=binary(n) ; bitvl=matsize(bitv) ; return(sum(i=1,bitvl[2],bitv[i])) ; }
    { for(i=1,8000000, if(bitcnt(i)==bitcnt(i^3), print1(i,",") ; ) ; ) ; }

Formula

A000120(a(n)) = A000120(a(n)^3).

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

A049343 Numbers m such that 2m and m^2 have same digit sum.

Original entry on oeis.org

0, 2, 9, 11, 18, 20, 29, 38, 45, 47, 90, 99, 101, 110, 119, 144, 146, 180, 182, 189, 198, 200, 245, 290, 299, 335, 344, 351, 362, 369, 380, 398, 450, 452, 459, 461, 468, 470, 479, 488, 495, 497, 639, 729, 794, 839, 848, 900, 929, 954, 990, 999
Offset: 1

Views

Author

Keywords

Comments

An easy way to prove that this sequence is infinite is to observe that it contains all numbers of the form 10^k+1. - Stefan Steinerberger, Mar 31 2006
For n>0: digital root (A010888) of 2n or n^2 is either 4 or 9. - Reinhard Zumkeller, Oct 01 2007

References

  • Problem 117 in Loren Larson's translation of Paul Vaderlind's book.

Crossrefs

Cf. A058369, A077436 (binary). - Reinhard Zumkeller, Apr 03 2011

Programs

  • Haskell
    import Data.List (elemIndices)
    import Data.Function (on)
    a049343 n = a049343_list !! (n-1)
    a049343_list = elemIndices 0
       $ zipWith ((-) `on` a007953) a005843_list a000290_list
    -- Reinhard Zumkeller, Apr 03 2011
    
  • Magma
    [n: n in [0..1000] | &+Intseq(2*n) eq &+Intseq(n^2)]; // Vincenzo Librandi, Nov 17 2015
  • Mathematica
    Select[Range[0, 1000], Sum[DigitCount[2# ][[i]]*i, {i, 1, 9}] == Sum[DigitCount[ #^2][[i]]*i, {i, 1, 9}] &] (* Stefan Steinerberger, Mar 31 2006 *)
    Select[Range[0,1000],Total[IntegerDigits[2#]]==Total[ IntegerDigits[ #^2]]&] (* Harvey P. Dale, Sep 25 2012 *)

Formula

A007953(A005843(a(n))) = A007953(A000290(a(n))). - Reinhard Zumkeller, Oct 01 2007

A212314 Numbers m such that B(m^3) = 3*B(m), where B(m) is the binary weight of m (A000120).

Original entry on oeis.org

0, 5, 9, 10, 17, 18, 20, 33, 34, 36, 39, 40, 49, 65, 66, 68, 69, 72, 78, 80, 98, 105, 129, 130, 132, 135, 136, 138, 144, 156, 160, 169, 196, 199, 209, 210, 229, 257, 258, 260, 263, 264, 270, 272, 276, 277, 288, 291, 297, 312, 313, 320, 338, 359, 365, 392, 395, 398, 418
Offset: 1

Views

Author

Alex Ratushnyak, Oct 24 2013

Keywords

Comments

2*k is a term if and only if k is a term. - Robert Israel, Nov 06 2022

Crossrefs

Programs

  • Maple
    select(n -> convert(convert(n^3,base,2),`+`) = 3*convert(convert(n,base,2),`+`), [$0..1000]); # Robert Israel, Nov 06 2022
  • PARI
    isok(m) = hammingweight(m^3) == 3*hammingweight(m); \\ Michel Marcus, Nov 06 2022
  • Python
    import math
    for n in range(10000):
        c1 = c2 = 0
        t = n
        while t:
            c1+=t&1
            t>>=1
        t = n*n*n
        while t:
            c2+=t&1
            t>>=1
        if c1*3==c2: print(str(n), end=',')
    
  • Sage
    s = lambda n: sum((n^3).digits(2)) - 3*sum(n.digits(2))
    [n for n in (0..418) if s(n)==0]  # Peter Luschny, Oct 24 2013
    

Formula

A000120(a(n)^3) = A000120(a(n)) * 3.

A261586 Odd numbers n such that the sum of the binary digits of n equals the sum of the binary digits of n^2.

Original entry on oeis.org

1, 3, 7, 15, 31, 63, 79, 91, 127, 157, 159, 183, 187, 255, 279, 287, 317, 319, 351, 365, 375, 379, 445, 511, 573, 575, 637, 639, 703, 735, 751, 759, 763, 815, 893, 975, 1023, 1071, 1087, 1145, 1149, 1151, 1215, 1255, 1277, 1279, 1407, 1449, 1455, 1463
Offset: 1

Views

Author

Keywords

Comments

A077436 consists of elements of this sequence times powers of 2.
Hare, Laishram, & Stoll show that this sequence is infinite. In particular for each k in {12, 13, 16, 17, 18, 19, 20, ...} there are infinitely many terms in this sequence with binary digit sum k.
Subsequence of A077436.

Examples

			15 = 1111_2 and 15^2 = 11100001_2, both of which have a Hamming weight (sum of binary digits) equal to 4.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1500 by 2] | &+Intseq(n, 2) eq &+Intseq(n^2, 2) ]; // Vincenzo Librandi, Aug 30 2015
  • Mathematica
    Select[Range[1, 1463, 2], Total@ IntegerDigits[#, 2] == Total@ IntegerDigits[#^2, 2] &] (* Michael De Vlieger, Aug 29 2015 *)
  • PARI
    is(n)=n%2 && hammingweight(n)==hammingweight(n^2)
    

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

A094695 Numbers having in binary representation fewer ones than in their squares.

Original entry on oeis.org

5, 9, 10, 11, 13, 17, 18, 19, 20, 21, 22, 25, 26, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 93, 97, 98, 99
Offset: 1

Views

Author

Reinhard Zumkeller, May 20 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[100],DigitCount[#,2,1]Harvey P. Dale, May 29 2017 *)

Formula

A000120(a(n)) < A000120(A000290(a(n))).

A212315 Numbers m such that B(m) = B(triangular(m)), where B(m) is the binary weight of m (A000120).

Original entry on oeis.org

0, 1, 3, 7, 15, 31, 39, 45, 63, 78, 79, 91, 93, 127, 139, 143, 158, 159, 175, 182, 187, 189, 222, 255, 286, 287, 318, 319, 351, 367, 375, 379, 381, 407, 446, 487, 511, 535, 543, 572, 574, 575, 607, 627, 638, 639, 703, 724, 727, 731, 747, 750, 759, 763, 765, 799, 823, 830
Offset: 1

Views

Author

Alex Ratushnyak, Oct 24 2013

Keywords

Crossrefs

Programs

  • Python
    def isa(n): return n.bit_count()==((n*(n+1))>>1).bit_count()
    print(list(n for n in range(10**3) if isa(n)))  # Dumitru Damian, Mar 04 2023

Formula

A000120(a(n)) = A000120(a(n)*(a(n)+1)/2).

A232243 a(n) = wt(n^2) - wt(n), where wt(n) = A000120(n) is the binary weight function.

Original entry on oeis.org

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

Views

Author

Jon Perry, Nov 20 2013

Keywords

Comments

A077436 lists n for which a(n) = 0.
A094694 lists n for which a(n) < 0.

Examples

			a(5): 5 = 101_2, 25 = 11001_2, so a(5) = 3 - 2 = 1.
a(23): 23 = 10111_2, 529 = 10001001_2, so a(23) = 3 - 4 = -1.
		

Crossrefs

Programs

  • JavaScript
    function bitCount(n) {
       var i,c,s;
       c=0;
       s=n.toString(2);
       for (i=0;i
    				
  • PARI
    a(n) = hammingweight(n^2) - hammingweight(n); \\ Michel Marcus, Mar 05 2023
  • Python
    def A232243(n): return (n**2).bit_count()-n.bit_count()
    print(list(A232243(n) for n in range(10**2)))  # Dumitru Damian, Mar 04 2023
    

Formula

a(n) = A159918(n) - A000120(n).
Previous Showing 11-20 of 28 results. Next