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 71-77 of 77 results.

A086772 Store the natural numbers in a triangular array such that values on each row have the same number of bits. Start a new row with the smallest number not yet recorded. a(n) represents the initial terms in the resulting array.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 15, 21, 24, 31, 41, 45, 63, 64, 72, 74, 83, 94, 127, 139, 140, 173, 197, 207, 234, 255, 268, 284, 288, 339, 349, 390, 426, 445, 467, 511, 522, 553, 569, 634, 689, 706, 734, 797, 838, 934, 950, 951, 1023, 1036, 1052, 1078, 1179, 1236
Offset: 0

Views

Author

Alford Arnold, Aug 03 2003

Keywords

Comments

A067576 describes the sequences with a fixed number of binary bits using antidiagonals.

Examples

			The array begins:
   0
   1  2
   3  5  6
   4  8 16 32
   7 11 13 14 19
   9 10 12 17 18 20
  15 23 27 29 30 39 43
  ...
so the initial terms are 0 1 3 4 7 9 15 ...
		

Crossrefs

Programs

  • Maple
    A086772aux := proc(n,k)
        option remember;
        local a,npr,kpr,fnd ;
        if n = 0 then
            return 0;
        end if;
        if k = 0 then
            for a from 1 do
                fnd := false;
                for npr from 1 to n-1 do
                    for kpr from 0 to npr do
                        if procname(npr,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        else
            for a from 1 do
                if wt(a) = wt(procname(n,0)) then
                    fnd := false;
                    for npr from 1 to n-1 do
                        for kpr from 0 to npr do
                            if procname(npr,kpr) = a then
                                fnd := true;
                                break;
                            end if;
                        end do:
                    end do:
                    for kpr from 0 to k-1 do
                        if procname(n,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                    if not fnd then
                        return a;
                    end if;
                end if;
            end do:
        end if;
    end proc:
    A086772 := proc(n)
        A086772aux(n,0) ;
    end proc: # R. J. Mathar, Sep 15 2012

A340161 a(n) is the smallest number k for which the set {k + 1, k + 2, ..., k + k} contains exactly n elements with exactly three 1-bits (A014311).

Original entry on oeis.org

1, 4, 6, 7, 10, 11, 13, 18, 19, 21, 25, 34, 35, 37, 41, 49, 66, 67, 69, 73, 81, 97, 130, 131, 133, 137, 145, 161, 193, 258, 259, 261, 265, 273, 289, 321, 385, 514, 515, 517, 521, 529, 545, 577, 641, 769, 1026, 1027, 1029, 1033, 1041, 1057, 1089, 1153, 1281, 1537
Offset: 0

Views

Author

Marius A. Burtea, Dec 30 2020

Keywords

Comments

When n = m*(m-1)/2 + 1, m >= 2 (A000124 \ {1}), then a(n) = k = 2^m+2, m >= 2 (A052548 \ {3, 4}), and only for these values of k, there exists only one set, {k+1, k+2, ..., 2k}, that contains exactly n elements whose binary representation has exactly three 1's (see A340068). - Bernard Schott, Jan 03 2021
From David A. Corneth, Jan 03 2021: (Start)
a(n) = A018900(n) + 1 for n >= 1.
Proof: Let T(k) be the number of values in {k+1, k+2, ..., k+k} that have exactly 3 ones in their binary expansion. Let h(k) be 1 if k has exactly 3 ones in its binary expansion and 0 otherwise and let w(k) be the binary weight of k (cf. A000120). Then T(k + 1) = T(k) + h(2*k + 1) + h(2*k + 2) - h(k + 1) = T(k) + h(2*k + 1) + h(2*(k + 1)) - h(k + 1) but as h(2^m * k) = h(k) two terms cancel and we have T(k + 1) = T(k) + h(2*k + 1). If w(2*k + 1) = w(k) + 1 = 3 then w(k) = 2 which holds for k in A018900. (End)

Examples

			For k in {1, 2, 3}, the sets are {1, 2}, {3, 4} and {4, 5, 6}, which do not contain numbers in A014311, so a(0) = 1.
For k = 4, the set is {5, 6, 7, 8} with 7 = A014311(1), so a(1) = 4.
For k = 6, the set {7, 8, 9, 10, 11, 12} contains the elements 7 = A014311(1) and 11 = A014311(2), so a(2) = 6.
		

Crossrefs

Essentially a duplicate of A018900 - N. J. A. Sloane, Jan 23 2021.
Cf. also A000124, A052548 \ {3} (is a subsequence).

Programs

  • Magma
    fb:=func; a:=[]; for n in [0..64] do k:=1; while #[s:s in [k+1..2*k]|fb(s)] ne n do k:=k+1; end while; Append(~a,k); end for; a;
    
  • PARI
    first(n) = {my(res = vector(n), t = 1); res[1] = 1; for(i = 2, oo, if(hammingweight(2*i-1) == 3, t++; if(t > n, return(res)); res[t] = i))} \\ David A. Corneth, Jan 03 2021
    
  • Python
    from math import isqrt, comb
    def A340161(n): return 1+(1<<(m:=isqrt(n<<3)+1>>1))+(1<<(n-1-comb(m,2))) if n else 1 # Chai Wah Wu, Mar 10 2025

Formula

From Bernard Schott, Jan 03 2021: (Start)
a(m*(m-1)/2 + 1) = 2^m + 2 for m >= 2.
a(m*(m-1)/2 + 2) = 2^m + 3 for m >= 2.
a(n) = A018900(n) + 1 for n >= 1 (see A340068). (End)

A356354 a(n) is the least k such that the sets of positions of 1's in the binary expansions of n and k are similar.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 11, 3, 11, 7, 15, 1, 3, 3, 19, 3, 7, 11, 23, 3, 19, 11, 27, 7, 23, 15, 31, 1, 3, 3, 35, 3, 37, 19, 39, 3, 37, 7, 43, 11, 45, 23, 47, 3, 35, 19, 51, 11, 43, 27, 55, 7, 39, 23, 55, 15, 47, 31, 63, 1, 3, 3, 67, 3, 11, 35, 71, 3, 7
Offset: 0

Views

Author

Rémy Sigrist, Oct 15 2022

Keywords

Comments

Let s(n) be the set of terms in the n-th row of A133457 (with s(0) = {}).
a(n) is the least k such that s(n) is the image of s(k) under some nonconstant linear function.

Examples

			The first terms, alongside their binary expansions, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     3      11         11
   4     1     100          1
   5     3     101         11
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     3    1001         11
  10     3    1010         11
  11    11    1011       1011
  12     3    1100         11
  13    11    1101       1011
  14     7    1110        111
  15    15    1111       1111
  16     1   10000          1
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A000120(a(n)) = A000120(n).
a(a(n)) = a(n).
a(2*n) = a(n).
a(A030101(n)) = a(n).
a(n) = 1 iff n is a power of 2.
a(n) = 3 iff n belongs to A018900.
a(2^k - 1) = 2^k - 1 for any k >= 0.

A078459 Numbers n such that in some base b <= log n the sum of the digits of n in base b equals b.

Original entry on oeis.org

9, 10, 12, 17, 18, 20, 21, 24, 29, 31, 33, 34, 36, 37, 39, 40, 45, 48, 55, 57, 63, 65, 66, 67, 68, 70, 72, 73, 76, 80, 82, 83, 85, 87, 88, 91, 93, 96, 97, 99, 100, 109, 111, 112, 117, 129, 130, 132, 133, 135, 136, 144, 145, 148, 153, 157, 160, 161, 163, 165, 171, 177
Offset: 1

Views

Author

Carlos Alves, Dec 31 2002

Keywords

Comments

The sequence A018900 refers to b=2. Other sequences with b=3,4,5,... could be considered separately. We present the case that includes the several b, provided that b<=Log(n) (this condition avoids trivial situations). - It is not completely clear how the sequence grows.

Examples

			In base 4, 67=(1003)_4 and the sum 1+0+0+3 equals 4.
		

Crossrefs

In a sense this generalizes the sequence A018900 (if b=2 is considered).

Programs

  • Mathematica
    Seq = Function[{m}, Module[{ls, sk}, ls = {}; Do[Do[ sk = Apply[Plus, IntegerDigits[k, b]]; If[sk == b && E^b <= k, AppendTo[ls, k]], {b, 2, Log[k]}], {k, 1, m}]; Union[Sort[ls]] ]]; Seq[1000]

A091860 a(1)=1, a(n)=sum(i=1,n-1,b(i)) where b(i)=0 if a(i) and a(n-i) are both even, b(i)=1 otherwise.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Mar 16 2004

Keywords

Crossrefs

Programs

  • PARI
    an[1]=1;for(n=2,100,an[n]=sum(i=1,n-1,max(a(i)%2,a(n-i)%2)))

Formula

n>1 a(2n)=a(n)+2; if n is a power of 2, a(2n+1)=1+a(2n); if n is the sum of 2 distinct power of 2, a(2n+1)=2+a(2n); a(2n+1)=a(2n) otherwise

A139369 Array read by antidiagonals, n-th sum of 2 distinct powers of k.

Original entry on oeis.org

3, 4, 5, 5, 10, 6, 6, 17, 12, 9, 7, 26, 20, 28, 10, 8, 37, 30, 65, 30, 12, 9, 50, 42, 126, 68, 36, 17, 10, 65, 56, 217, 130, 80, 82, 18, 11, 82, 72, 344, 222, 150, 257, 84, 20, 12, 101, 90, 513, 350, 252, 626, 260, 90, 24, 13, 122, 110, 730, 520, 392, 1297, 630, 272, 108
Offset: 1

Views

Author

Jonathan Vos Post, Jun 07 2008

Keywords

Comments

n=2 column is A002522 n^2 + 1.
n=3 column is A002378 n*(n+1) Oblong (or pronic, promic, or heteromecic numbers).

Examples

			Array begins:
================================================================================
k....|.n=1.|.n=2.|.n=3.|..n=4.|..n=5.|..n=6.|...n=7.|...n=8.|..n=9.|.n=10|.OEIS.
================================================================================
k=2..|..3..|...5.|..6..|....9.|...10.|...12.|....17.|...18..|...20.|..24.|A018900
k=3..|..4..|..10.|.12..|...28.|...30.|...36.|....82.|...84..|...90.|..108|A038464
k=4..|..5..|..17.|.20..|...65.|...68.|...80.|...257.|..260..|..272.|..320|A038470
k=5..|..6..|..26.|.30..|..126.|..130.|..150.|...626.|..630..|..650.|..750|A038474
k=6..|..7..|..37.|.42..|..217.|..222.|..252.|..1297.|..1302.|.1332.|.1512|A038478
k=7..|..8..|..50.|.56..|..344.|..350.|..392.|..2402.|..2408.|.2450.|.2744|A038481
k=8..|..9..|..65.|.72..|..513.|..520.|..576.|..4097.|..4104.|.4160.|.4608|A038484
k=9..|.10..|..82.|.90..|..730.|..738.|..810.|..6562.|..6570.|.6642.|.7290|A038487
k=10.|.11..|.101.|.110.|.1001.|.1010.|.1100.|.10001.|.10010.|10100.|11000|A038444
k=11.|.12..|.122.|.132.|.1332.|.1342.|.1452.|.14642.|.14652.|14762.|15972|A038490
k=12.|.13..|.145.|.156.|.1729.|.1740.|.1872.|.20737.|.20748.|20880.|22464|A038492
================================================================================
		

Crossrefs

A367680 Number of integer compositions x1+x2+...+xk of n such that each xj has exactly j bits set.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 1, 3, 2, 1, 2, 4, 2, 4, 6, 2, 4, 5, 10, 7, 10, 12, 8, 6, 11, 14, 16, 13, 16, 16, 14, 14, 30, 32, 19, 35, 28, 23, 27, 38, 36, 47, 44, 42, 55, 52, 51, 85, 88, 74, 84, 84, 72, 81, 102, 110, 122, 115, 108, 132, 137, 136, 179, 195, 164, 160, 181
Offset: 0

Views

Author

Arnauld Chevallier, Nov 26 2023

Keywords

Examples

			There are 6 such compositions for n = 14:
  14 = 1 + 6 + 7 (1 + 110 + 111)
  14 = 2 + 5 + 7 (10 + 101 + 111)
  14 = 2 + 12 (10 + 1100)
  14 = 4 + 3 + 7 (100 + 11 + 111)
  14 = 4 + 10 (100 + 1010)
  14 = 8 + 6 (1000 + 110)
Therefore a(14) = 6.
		

Crossrefs

Programs

  • PARI
    a(n) = my(nb=0); forpart(v=n, if (vecsort(apply(hammingweight, Vec(v))) == [1..#v], nb++)); nb; \\ Michel Marcus, Nov 28 2023
Previous Showing 71-77 of 77 results.