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-2 of 2 results.

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

A358268 a(n) is the least number k > 0 such that the binary weight of k^n is n times the binary weight of k.

Original entry on oeis.org

1, 21, 5, 21, 17, 17, 9, 113, 17, 49, 665, 37, 149, 17, 275, 163, 33, 41, 97, 67, 141, 67, 135, 197, 49, 267, 81, 81, 69, 779, 1163, 69, 325, 49, 587, 837, 281, 197, 293, 49, 147, 677, 67, 651, 647, 67, 793, 277, 353, 49, 1233, 1177, 165, 775, 721, 353, 817, 69, 647, 709, 209, 1233, 69, 67, 263
Offset: 1

Views

Author

Robert Israel, Nov 06 2022

Keywords

Comments

a(n) is the least number k > 0 such that A000120(k^n) = n*A000120(k).
All terms are odd.
Conjecture: lim_{n -> infinity} a(n) = infinity.

Examples

			a(3) = 5 because 5 = 101_2 and 5^3 = 1111101_2 so A000120(5) = 2, A000120(5^3) = 6 and 6 = 3*2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
        for k from 1 by 2 do
          if convert(convert(k^n,base,2),`+`) = n*convert(convert(k,base,2),`+`) then return k
          fi
        od
    end proc:
    map(f, [$1..50]);
  • Mathematica
    a[n_] := Module[{k = 1}, While[Divide @@ DigitCount[k^{n, 1}, 2, 1] != n, k += 2]; k]; Array[a, 65] (* Amiram Eldar, Nov 07 2022 *)
  • PARI
    a(n) = my(k=1); while (hammingweight(k^n) != n*hammingweight(k), k++); k; \\ Michel Marcus, Nov 07 2022
  • Python
    def a(n):
        k = 1
        while bin(k**n).count("1") != n*bin(k).count("1"): k += 2
        return k
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Nov 06 2022
    
  • Python
    from itertools import count
    def A358268(n): return next(filter(lambda k:k.bit_count()*n==(k**n).bit_count(),count(1,2))) # Chai Wah Wu, Nov 07 2022
    
Showing 1-2 of 2 results.