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

A089998 Smallest square with Hamming weight n (i.e., with exactly n 1's when written in binary).

Original entry on oeis.org

0, 1, 9, 25, 169, 121, 441, 1521, 2025, 5625, 24025, 47089, 109561, 32761, 393129, 851929, 1540081, 6275025, 15327225, 27258841, 41925625, 127893481, 243204025, 385611769, 998244025, 1979449081, 4823441401, 12870221809, 34324602361
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 20 2003

Keywords

Comments

A000120(a(n)) = n.

Crossrefs

Programs

  • Mathematica
    a = Table[0, {30}]; Do[c = Count[IntegerDigits[n^2, 2], 1]; If[ a[[c + 1]] == 0, a[[c + 1]] = n^2; Print[c, " = ", n^2]], {n, 1, 360000}] (* Robert G. Wilson v, Dec 03 2003 *)
    Join[{0},With[{s=DigitCount[Range[400000]^2,2,1]},Flatten[Table[ Position[ s,?(#==n&),1,1],{n,30}]]]^2] (* _Harvey P. Dale, Mar 03 2013 *)

Formula

a(n) = A231897(n)^2. - Hugo Pfoertner, Dec 27 2022

Extensions

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

A090002 Length of longest contiguous block of 1's in binary expansion of n-th triangular number.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 20 2003

Keywords

Comments

a(n) = A038374(A000217(n)).

Crossrefs

Programs

  • Mathematica
    Join[{0},Max[Length/@Select[Split[IntegerDigits[#,2]],#[[1]]==1&]]&/@ Accumulate[ Range[110]]] (* Harvey P. Dale, Jul 28 2022 *)

A211201 Smallest m such that (sum of binary digits of m*(m+1)/2) = n.

Original entry on oeis.org

0, 1, 2, 6, 5, 10, 19, 22, 37, 77, 108, 165, 90, 313, 461, 620, 1252, 1957, 2610, 3237, 5654, 7797, 9818, 15797, 22245, 34725, 56723, 92634, 122330, 178540, 226838, 507571, 454045, 490426, 1480005, 2284378, 1482842, 2965594, 5931098, 10218573, 11096982, 21793257, 31317157
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 04 2013

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a211201 = fromJust . (`elemIndex` a050493_list)
    
  • PARI
    a(n) = my(m=0); while (hammingweight(m*(m+1)/2) != n, m++); m; \\ Michel Marcus, Jan 27 2022

Formula

A050493(a(n)) = n and A050493(m) <> n for m < a(n).

A102029 Smallest semiprime with Hamming weight n (i.e., smallest semiprime with exactly n ones when written in binary), or -1 if no such number exists.

Original entry on oeis.org

4, 6, 14, 15, 55, 95, 247, 447, 511, 1535, 2047, 7167, 12287, 32255, 49151, 98303, 196607, 393215, 983039, 1572863, 3145727, 6291455, 8388607, 33423359, 50331647, 117440511, 201326591, 528482303, 805306367, 1879048191, 3221225471
Offset: 1

Views

Author

Jonathan Vos Post, Jun 23 2007

Keywords

Comments

Semiprime analog of A061712. Extended by Stefan Steinerberger. Includes the subset Mersenne semiprimes A092561.

Examples

			a(1) = 4 because the first semiprime A001358(1) is 4 (base 10) which is written 100 in binary, the latter representation having exactly 1 one.
a(2) = 6 since A001358(2) = 6 = 110 (base 2) has exactly 2 ones.
a(4) = 15 since A001358(6) = 15 = 1111 (base 2) has exactly 4 ones and, as it also has no zeros, is the smallest of the Mersenne semiprimes.
		

Crossrefs

Programs

  • Mathematica
    Join[{4},Table[SelectFirst[Sort[FromDigits[#,2]&/@Permutations[ Join[ PadRight[{}, n,1],{0}]]],PrimeOmega[#]==2&],{n,2,40}]] (* Harvey P. Dale, Feb 06 2015 *)

A358930 a(n) is the smallest n-gonal number with binary weight n.

Original entry on oeis.org

21, 169, 117, 190, 1404, 9976, 3961, 11935, 19966, 113401, 98155, 208879, 261501, 3338221, 916475, 3100671, 9943039, 31457140, 50322871, 100523871, 264240373, 2113871829, 2012739435, 532673535, 7415513007, 33017544153, 17112759966, 50983861215, 59039022015
Offset: 3

Views

Author

Ilya Gutkovskiy, Dec 06 2022

Keywords

Examples

			117 is the smallest pentagonal number with binary weight 5 (117_10 = 1110101_2), so a(5) = 117.
		

Crossrefs

Programs

  • Mathematica
    p[n_, k_] := (n - 2)*k*(k - 1)/2 + k; a[n_] := Module[{k = 1, pk}, While[DigitCount[pk = p[n, k], 2, 1] != n, k++]; pk]; Array[a, 25, 3] (* Amiram Eldar, Dec 09 2022 *)

A359315 a(n) is the smallest centered triangular number with binary weight n.

Original entry on oeis.org

1, 10, 19, 46, 31, 235, 631, 1786, 1999, 7669, 7039, 12286, 16381, 180094, 114679, 949231, 2086831, 2883574, 4175839, 12480511, 50329585, 62898151, 132638719, 234618814, 771743710, 2883510271, 4269733885, 8254119871, 17045499901, 33214168831
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 25 2022

Keywords

Examples

			235 is the smallest centered triangular number with binary weight 6 (235_10 = 11101011_2), so a(6) = 235.
		

Crossrefs

Programs

  • Mathematica
    seq[len_,nmax_] := Module[{s = Table[0,{len}], n = 1, c = 0, bw, ct}, While[c < len && n < nmax, bw = DigitCount[ct = 3*n*(n-1)/2 + 1, 2, 1]; If[bw <= len && s[[bw]] == 0, c++; s[[bw]] = ct]; n++]; s]; seq[30, 10^6] (* Amiram Eldar, Dec 26 2022 *)

A359317 a(n) is the smallest tetrahedral number with binary weight n.

Original entry on oeis.org

0, 1, 10, 35, 120, 220, 455, 2024, 1771, 4060, 14190, 16215, 129766, 32509, 1414910, 1823471, 5159805, 8171255, 4192244, 24117100, 30865405, 334985911, 192937325, 1610599145, 1048440315, 4261347265, 4244012991, 63828916911, 213588635511, 133110357279
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 25 2022

Keywords

Examples

			455 is the smallest tetrahedral number with binary weight 6 (455_10 = 111000111_2), so a(6) = 455.
		

Crossrefs

Programs

  • Mathematica
    seq[len_,nmax_] := Module[{s = Table[0,{len}], n = 0, c = 0, bw, t}, While[c < len && n < nmax, bw = DigitCount[t = n*(n+1)*(n+2)/6, 2, 1] + 1; If[bw <= len && s[[bw]] == 0, c++; s[[bw]] = t]; n++]; s]; seq[30, 10^6] (* Amiram Eldar, Dec 26 2022 *)

A354480 a(n) is the smallest decimal palindrome with Hamming weight n (i.e., with exactly n 1's when written in binary).

Original entry on oeis.org

0, 1, 3, 7, 77, 55, 111, 191, 383, 767, 5115, 11711, 15351, 30703, 81918, 97279, 744447, 978879, 1570751, 3665663, 8387838, 66911966, 66322366, 132111231, 199212991, 389545983, 939474939, 3204444023, 3220660223, 11542724511, 34258485243, 33788788733, 34292629243
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 02 2022

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice, product
    def pals(startd=1): # generator for base-10 palindromes
        for d in count(startd):
            for p in product("0123456789", repeat=d//2):
                if d//2 > 0 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], "0123456789"][d%2]:
                    yield int(left + mid + right)
    def a(n):
        for p in pals(startd=len(str(2**n-1))):
            if bin(p).count("1") == n:
                return p
    print([a(n) for n in range(33)]) # Michael S. Branicky, Jun 02 2022

Extensions

a(21)-a(32) from Michael S. Branicky, Jun 02 2022
Showing 1-8 of 8 results.