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.

A089999 Smallest triangular number with Hamming weight n (i.e., with exactly n 1's when written in binary).

Original entry on oeis.org

0, 1, 3, 21, 15, 55, 190, 253, 703, 3003, 5886, 13695, 4095, 49141, 106491, 192510, 784378, 1915903, 3407355, 5240703, 15986685, 30400503, 48201471, 124780503, 247431135, 602930175, 1608777726, 4290575295, 7482375615, 15938355070
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 20 2003

Keywords

Comments

A000120(a(n)) = n.
a(n) = A000217(A211201(n)). - Reinhard Zumkeller, Mar 18 2013

Crossrefs

Programs

  • Haskell
    a089999 = a000217 . a211201  -- Reinhard Zumkeller, Mar 18 2013
  • Mathematica
    a = Table[0, {30}]; Do[t = n(n + 1)/2; c = Count[ IntegerDigits[t, 2], 1]; If[ a[[c + 1]] == 0, a[[c + 1]] = t], {n, 1, 10^8}]; a (* Robert G. Wilson v, Dec 03 2003 *)

Extensions

More terms from Robert G. Wilson v, Dec 03 2003
Offset corrected by Donovan Johnson, May 01 2012

A231897 a(n) = smallest m such that wt(m^2) = n (where wt(i) = A000120(i)), or -1 if no such m exists.

Original entry on oeis.org

0, 1, 3, 5, 13, 11, 21, 39, 45, 75, 155, 217, 331, 181, 627, 923, 1241, 2505, 3915, 5221, 6475, 11309, 15595, 19637, 31595, 44491, 69451, 113447, 185269, 244661, 357081, 453677, 1015143, 908091, 980853, 2960011, 4568757, 2965685, 5931189, 11862197, 20437147
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2013

Keywords

Comments

Conjecture: a(n) is never -1. (It seems likely that the arguments of Lindström (1997) could be modified to establish this conjecture.)
a(n) is the smallest m such that A159918(m) = n (or -1 if ...).

Crossrefs

A089998 are the corresponding squares.

Programs

  • Haskell
    a231897 n = head [x | x <- [1..], a159918 x == n]
    -- Reinhard Zumkeller, Nov 20 2013
    
  • PARI
    a(n)=if(n,my(k); while(hammingweight(k++^2)!=n,); k, 0) \\ Charles R Greathouse IV, Aug 06 2015
    
  • Python
    def wt(n): return bin(n).count('1')
    def a(n):
        m = 2**(n//2) - 1
        while wt(m**2) != n: m += 1
        return m
    print([a(n) for n in range(32)]) # Michael S. Branicky, Feb 06 2022

Formula

a(n) = 2*A211201(n-1) + 1 for n >= 1. - Hugo Pfoertner, Feb 06 2022

Extensions

a(26)-a(40) from Reinhard Zumkeller, Nov 20 2013

A050493 a(n) = sum of binary digits of n-th triangular number.

Original entry on oeis.org

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

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 27 1999

Keywords

Comments

See A211201 for smallest numbers m such that a(m) = n. - Reinhard Zumkeller, Feb 04 2013

Crossrefs

Programs

Formula

a(n) = Sum_{i=1..floor(log_b(c(n)))+1} (floor(c(n)/b^(i-1)) - floor(c(n)/b^i)*b), b=2, n >= 1, a(0)=0, c(n)=A000217(n).
a(n) = A000120(A000217(n)). - Reinhard Zumkeller, Feb 04 2013
a(n) = [x^(n*(n+1)/2)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018

A351149 a(n) is the least exponent k such that the Hamming weight of n^(k+1) is not greater than the Hamming weight of n^k.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Feb 07 2022

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[DigitCount[n^k, 2, 1] < DigitCount[n^(k + 1), 2, 1], k++]; k]; Array[a, 100] (* Amiram Eldar, Feb 07 2022 *)
  • PARI
    for(n=1,87, for(k=1,oo, my(hw1=hammingweight(n^k), hw2=hammingweight(n^(k+1))); if(hw2<=hw1, print1(k,", "); break)))
    
  • Python
    def A351149(n):
        k = 1
        while bin(n**k)[2:].count("1") < bin(n**(k+1))[2:].count("1"): k += 1
        return(k)
    print([A351149(n) for n in range(1, 88)]) # Karl-Heinz Hofmann, Feb 07 2022

A359091 a(n) is the index of the smallest n-gonal number with binary weight n.

Original entry on oeis.org

6, 13, 9, 10, 24, 58, 34, 55, 67, 151, 134, 187, 201, 691, 350, 623, 1082, 1870, 2302, 3171, 5017, 13863, 13230, 6663, 24357, 50397, 35604, 60347, 63810, 107019, 181517, 365595, 624858, 1345485, 1002585, 1969415, 1191179, 7651731, 4592173, 7279863, 7403686, 17923182
Offset: 3

Views

Author

Ilya Gutkovskiy, Dec 16 2022

Keywords

Crossrefs

Programs

  • Mathematica
    p[n_, k_] := (n - 2)*k*(k - 1)/2 + k; a[n_] := Module[{k = 1}, While[DigitCount[p[n, k], 2, 1] != n, k++]; k]; Array[a, 30, 3] (* Amiram Eldar, Dec 17 2022 *)
Showing 1-5 of 5 results.