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 51-60 of 77 results. Next

A038463 Sums of 12 distinct powers of 2.

Original entry on oeis.org

4095, 6143, 7167, 7679, 7935, 8063, 8127, 8159, 8175, 8183, 8187, 8189, 8190, 10239, 11263, 11775, 12031, 12159, 12223, 12255, 12271, 12279, 12283, 12285, 12286, 13311, 13823, 14079, 14207, 14271, 14303, 14319, 14327, 14331, 14333
Offset: 1

Views

Author

Keywords

Crossrefs

Base 2 interpretation of A038454.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691, A038461, A038462 (Hamming weight = 1, 2, ..., 11).

Programs

  • Mathematica
    Select[Range[15000], DigitCount[#, 2, 1] == 12 &] (* Amiram Eldar, Feb 14 2022 *)
  • Python
    from itertools import islice
    def A038463_gen(): # generator of terms
        yield (n:=4095)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A038463_list = list(islice(A038463_gen(),20)) # Chai Wah Wu, Mar 10 2025

Formula

Sum_{n>=1} 1/a(n) = 1.386296350824871649202152615241744383837323713474767661902780220440945591424... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A136318 Integers whose binary representation contains exactly two 1s, the 1s not being adjacent.

Original entry on oeis.org

5, 9, 10, 17, 18, 20, 33, 34, 36, 40, 65, 66, 68, 72, 80, 129, 130, 132, 136, 144, 160, 257, 258, 260, 264, 272, 288, 320, 513, 514, 516, 520, 528, 544, 576, 640, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176
Offset: 1

Views

Author

Gil Broussard, Mar 24 2008

Keywords

Comments

Subsequence of A018900. - Chai Wah Wu, Apr 07 2025

Examples

			a(1) = 5 = 101_2.
a(2) = 9 = 1001_2.
a(3) = 10 = 1010_2.
a(100) = 33024 = 1000000100000000_2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2500],DigitCount[#,2,1]==2&&SequenceCount[IntegerDigits[#,2],{1,1}]==0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 25 2017 *)
  • Python
    from math import isqrt, comb
    def A136318(n): return (1<<(m:=isqrt(n<<3)+1>>1)+1)+(1<Chai Wah Wu, Apr 07 2025

A161989 Numbers having more than 2 or fewer than 2 ones in their binary representation.

Original entry on oeis.org

0, 1, 2, 4, 7, 8, 11, 13, 14, 15, 16, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 67, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 24 2009

Keywords

Comments

A000120(a(n)) <> 2.
Complement of A018900; A151774(a(n)) = 0.

Crossrefs

Programs

  • Mathematica
    Select[Range[0,100],DigitCount[#,2,1]!=2&] (* Harvey P. Dale, Mar 11 2013 *)
  • PARI
    isok(n) = hammingweight(n) != 2; \\ Michel Marcus, Nov 01 2019
    
  • Python
    from itertools import count, islice
    from math import comb
    def A161989(n):
        def f(x):
            s = bin(x)[2:]
            c = n-1+comb((l:=len(s))-1,2)
            try:
                c += l-1-s[1:].index('1')
            except:
                pass
            return c
        m, k = n-1, f(n-1)
        while m != k: m, k = k, f(k)
        return m
    def A161989_gen(): # generator of terms
        return filter(lambda n:n.bit_count()!=2,count(0))
    A161989_list = list(islice(A161989_gen(),50)) # Chai Wah Wu, Oct 30 2024

A239713 Primes of the form m = 3^i + 3^j - 1, where i > j >= 0.

Original entry on oeis.org

3, 11, 29, 83, 89, 107, 251, 269, 809, 971, 2213, 2267, 6563, 6569, 6803, 8747, 19709, 19763, 20411, 59051, 65609, 177173, 183707, 531521, 538001, 590489, 1594331, 1594403, 1595051, 1596509, 4782971, 4782977, 4783697, 14348909, 14349149, 14526053, 14880347
Offset: 1

Views

Author

Hieronymus Fischer, Mar 28 2014

Keywords

Comments

The base-3 representation of a term 3^i + 3^j - 1 has base-3 digital sum = 1 + 2*j == 1 (mod 2).
In base-3 representation the first terms are 10, 102, 1002, 10002, 10022, 10222, 100022, 100222, 1002222, 1022222, 10000222, 10002222, 100000002, 100000022, 100022222, 102222222, 1000000222, 1000002222, 1000222222, 10000000002, 10022222222, 100000000222, 100022222222, ...

Examples

			a(1) = 3, since 3 = 3^1 + 3^0 - 1 is prime.
a(5) = 89, since 89 = 3^4 + 3^2 - 1 is prime.
		

Crossrefs

Cf. A018900, A239709, A239712 (base 2), A239714 (base 4), A239715 (base 5), A239716 (base 6), A239717 (base 7), A239718 (base 8), A239719 (base 9), A239720 (base 10).

Programs

  • Maple
    select(isprime, [seq(seq(3^i+3^j-1, j=0..i-1), i=1..25)])[];  # Alois P. Heinz, Dec 22 2024
  • Mathematica
    Select[Flatten[Table[3^i + 3^j - 1, {i, 1, 25}, {j, 0, i - 1}]], PrimeQ] (* Jean-François Alcover, Mar 17 2025, after Alois P. Heinz *)
  • Smalltalk
    A239713
    "Answers the n-th term of A239713.
      Usage: n A239713
      Answer: a(n)"
      | a b i j k p q terms |
      terms := OrderedCollection new.
      k := 0.
      b := 3.
      p := b.
      i := 1.
      [k < self] whileTrue:
             [j := 0.
             q := 1.
             [j < i and: [k < self]] whileTrue:
                       [a := p + q - 1.
                       a isPrime
                            ifTrue:
                                [k := k + 1.
                                terms add: a].
                       q := b * q.
                       j := j + 1].
             i := i + 1.
             p := b * p].
         ^terms at: self
    [by Hieronymus Fischer, Apr 14 2014]
    --------------------
    
  • Smalltalk
    A239713
    "Version 2: Answers the n-th term of A239713.
      Uses distinctPowersOf: b from A018900
      Usage: n A239713
      Answer: a(n)”
      | a k n terms |
      terms := OrderedCollection new.
      n := 1.
      k := 0.
      [k < self] whileTrue:
             [(a:= (n distinctPowersOf: 3) - 1)
                  isPrime ifTrue:    [k := k + 1.
                                     terms add: a].
                  n := n + 1].
      ^terms at: self
    [by Hieronymus Fischer, Apr 22 2014]
    -----------
    
  • Smalltalk
    A239713
      "Version 3: Answer an array of the first n terms of A239713.
      Uses method primesWhichAreDistinctPowersOf: b withOffset: d from A239712.
      Usage: n A239713
      Answer: #(3 11 29 ... ) [a(1) ... a(n)]”
      ^self primesWhichAreDistinctPowersOf: 3 withOffset: -1
    [by Hieronymus Fischer, Apr 22 2014]

A329627 Smallest BII-number of a clutter (connected antichain) with n edges.

Original entry on oeis.org

0, 1, 20, 52, 308, 820, 2868, 68404, 199476, 723764
Offset: 0

Views

Author

Gus Wiseman, Nov 28 2019

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793. We define the set-system with BII-number n to be obtained by taking the binary indices of each binary index of n. Every set-system (finite set of finite nonempty sets of positive integers) has a different BII-number. For example, 18 has reversed binary expansion (0,1,0,0,1), and since the binary indices of 2 and 5 are {2} and {1,3} respectively, the BII-number of {{2},{1,3}} is 18. Elements of a set-system are sometimes called edges.
A set-system is an antichain if no edge is a proper subset of any other.
For n > 1, a(n) appears to be the number whose binary indices are the first n terms of A018900.

Examples

			The sequence of terms together with their corresponding set-systems begins:
       0: {}
       1: {{1}}
      20: {{1,2},{1,3}}
      52: {{1,2},{1,3},{2,3}}
     308: {{1,2},{1,3},{2,3},{1,4}}
     820: {{1,2},{1,3},{2,3},{1,4},{2,4}}
    2868: {{1,2},{1,3},{2,3},{1,4},{2,4},{3,4}}
   68404: {{1,2},{1,3},{2,3},{1,4},{2,4},{3,4},{1,5}}
  199476: {{1,2},{1,3},{2,3},{1,4},{2,4},{3,4},{1,5},{2,5}}
  723764: {{1,2},{1,3},{2,3},{1,4},{2,4},{3,4},{1,5},{2,5},{3,5}}
		

Crossrefs

The version for MM-numbers is A329555.
BII-numbers of clutters are A326750.
Clutters of sets are counted by A048143.
Minimum BII-numbers of connected set-systems are A329625.
Minimum BII-numbers of antichains are A329626.
MM-numbers of connected weak antichains of multisets are A329559.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    stableQ[u_,Q_]:=!Apply[Or,Outer[#1=!=#2&&Q[#1,#2]&,u,u,1],{0,1}];
    csm[s_]:=With[{c=Select[Subsets[Range[Length[s]],{2}],Length[Intersection@@s[[#]]]>0&]},If[c=={},s,csm[Sort[Append[Delete[s,List/@c[[1]]],Union@@s[[c[[1]]]]]]]]];
    First/@GatherBy[Select[Range[0,10000],stableQ[bpe/@bpe[#]]&&Length[csm[bpe/@bpe[#]]]<=1&],Length[bpe[#]]&]

A338328 G.f. A(x) satisfies: [x^n] (1 + n*x - A(x))^(2*n-1) = 0, for n > 0.

Original entry on oeis.org

1, 1, 8, 129, 3216, 108770, 4638624, 238318885, 14304161568, 981167968494, 75656236536880, 6474624435825546, 608726166485138400, 62351661805733365988, 6910034200942823999216, 823702177681649409615885, 105083183676401369775220288, 14284797856254053619382213974
Offset: 1

Views

Author

Paul D. Hanna, Oct 24 2020

Keywords

Comments

Compare to: [x^n] (1 + n*x - C(x))^(n+1) = 0, for n>0, where C(x) = x + C(x)^2 is a g.f. of the Catalan numbers (A000108).
Compare to: [x^n] (1 + n*x - W(x))^n = 0, for n>0, where W(x) = Sum_{n>=1} (n-1)^(n-1)*x^n/n! = 1 + x/LambertW(-x).

Examples

			G.f.: A(x) = x + x^2 + 8*x^3 + 129*x^4 + 3216*x^5 + 108770*x^6 + 4638624*x^7 + 238318885*x^8 + 14304161568*x^9 + 981167968494*x^10 + 75656236536880*x^11 + ...
ILLUSTRATION OF DEFINITION.
The table of coefficients of x^k in (1 + n*x - A(x))^(2*n-1) begins:
n=0: [1, 1, 2, 11, 150, 3522, 116004, 4875971, 248249926, ...];
n=1: [1, 0, -1, -8, -129, -3216, -108770, -4638624, -238318885, ...];
n=2: [1, 3, 0, -29, -435, -10395, -344980, -14551710, -742232889, ...];
n=3: [1, 10, 35, 0, -995, -22108, -685040, -27845120, -1387317400, ...];
n=4: [1, 21, 182, 763, 0, -44352, -1308496, -49463691, -2359476623, ...];
n=5: [1, 36, 567, 5016, 24795, 0, -2460798, -90517248, -4024228311, ...];
n=6: [1, 55, 1364, 19987, 188111, 1076779, 0, -163739444, -7210725280, ...];
n=7: [1, 78, 2795, 60736, 886665, 8986692, 58632756, 0, -12708845682, ...];
n=8: [1, 105, 5130, 154475, 3196890, 47836926, 523400300, 3840855735, 0, ...]; ...
in which the main diagonal is all zeros after the initial term, illustrating that [x^n] (1 + n*x - A(x))^(2*n-1) = 0, for n > 0.
ODD TERMS.
The odd terms seem to occur only at positions equal to powers of 2: a(1), a(2), a(4), a(8), a(16), ...; the odd terms begin: [1, 1, 129, 238318885, 823702177681649409615885, 1728309826852815676925583353579702599032084743126745454358749, ...].
RELATED SERIES.
1/(1 - A(x)) = 1 + x + 2*x^2 + 11*x^3 + 150*x^4 + 3522*x^5 + 116004*x^6 + 4875971*x^7 + 248249926*x^8 + 14807944838*x^9 + 1011137601996*x^10 + ...
Series_Reversion(A(x)) = x - x^2 - 6*x^3 - 94*x^4 - 2404*x^5 - 83808*x^6 - 3667808*x^7 - 192327976*x^8 - 11726343040*x^9 - 814059155216*x^10 - ...
		

Crossrefs

Programs

  • PARI
    {a(n) = my(A=[1],m=1); for(i=1,n, A=concat(A,0);
    m=#A; A[#A] = polcoeff( (1 + m*x - x*Ser(A))^(2*m-1), m)/(2*m-1) );A[n]}
    for(n=1,30,print1(a(n),", "))

Formula

a(n) is odd iff n is a power of 2 (conjecture).
a(n) = 2 (mod 4) iff n is twice the sum of two distinct powers of 2 (conjecture).
a(n) ~ c * d^n * n! / n^2, where d = (1+r) / ((-1 + exp(r + LambertW(-1, -exp(-r)*r))) * LambertW(-exp(-1-r)*(1+r))) = 8.406107401279769476199925123910168..., r = 0.7545302104650497245839827141610818561001159135034... is the root of the equation r*(1 + r + LambertW(-exp(-1 - r)*(1 + r))) = -(1 + r)*(r + LambertW(-1, -exp(-r)*r)) and c = 0.0183535737... - Vaclav Kotesovec, Oct 25 2020, updated Dec 29 2021

A340068 a(n) is the number of integers in the set {n+1,n+2, . . . ,2n} whose representation in base 2 contain exactly three digits 1’s.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17, 17, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Bernard Schott, Dec 28 2020

Keywords

Comments

This sequence is inspired by the 3rd problem, proposed by Romania, during the 35th International Mathematical Olympiad in 1994 at Hong Kong (see the link IMO).
This sequence is increasing because there are only these two possibilities:
-> a(n+1) - a(n) = 1 if n has exactly two 1's in its binary representation (A018900);
-> a(n+1) - a(n) = 0 otherwise.
Consequence, for any positive integer m, a(x) = m has at least one solution (answer to the 1st Olympiad question).
Only when m = k*(k-1)/2 + 1 with k >= 2 (A000124 \ {1}), there exists only one n such that a(n) = m, and then n = 2^k+2 where k >= 2 (A052548 \ {3, 4}) (answer to the 2nd Olympiad question).

Examples

			a(2) = 0 because in {3, 4}, 3 = 11_2 and 4 = 100_2.
a(4) = 1 because in {5, 6, 7, 8, 9, 10} only 7 = 111_2 has 3 digits in its binary representation.
a(6) = 2 because in {7, 8, 9, 10, 11, 12}, there are 7 = 111_2 and 11 = 1011_2 that have 3 digits in their binary representation.
		

References

  • Marcin E. Kuczma, International Mathematical Olympiads, 1986-1999, The Mathematical Association of America, 2003, pages 10 and 92-93.

Crossrefs

Cf. A000120, A014311, A018900, A057168, A151774 (first differences).

Programs

Formula

a(2^k+2) = k*(k-1)/2 + 1 for k >= 2.

Extensions

More terms from David A. Corneth, Dec 28 2020

A382292 Numbers k such that A382290(k) = 1.

Original entry on oeis.org

8, 24, 27, 32, 40, 54, 56, 64, 72, 88, 96, 104, 108, 120, 125, 135, 136, 152, 160, 168, 184, 189, 192, 200, 224, 232, 243, 248, 250, 264, 270, 280, 288, 296, 297, 312, 320, 328, 343, 344, 351, 352, 360, 375, 376, 378, 392, 408, 416, 424, 432, 440, 448, 456, 459, 472, 480, 486, 488, 500
Offset: 1

Views

Author

Amiram Eldar, Mar 21 2025

Keywords

Comments

First differs from A374590 and A375432 at n = 25: A374590(25) = A375432(25) = 216 is not a term of this sequence.
Numbers k such that A382291(k) = 2, i.e., numbers whose number of infinitary divisors is twice the number of their unitary divisors.
Numbers whose prime factorization has a single exponent that is a sum of two distinct powers of 2 (A018900) and all the other exponents, if they exist, are powers of 2. Equivalently, numbers of the form p^e * m, where p is a prime, e is a term in A018900, and m is a term in A138302 that is coprime to p.
If k is a term then k^2 is also a term. If m is a term in A138302 that is coprime to k then k * m is also a term. The primitive terms, i.e., the terms that cannot be generated from smaller terms using these rules, are the numbers of the form p^(2^i+1), where p is prime and i >= 1.
Analogous to A060687, which is the sequence of numbers k with prime excess A046660(k) = 2.
The asymptotic density of this sequence is A271727 * Sum_{p prime} (((1 - 1/p)/f(1/p)) * Sum_{k>=1} 1/p^A018900(k)) = 0.11919967112489084407..., where f(x) = 1 - x^3 + Sum_{k>=2} (x^(2^k)-x^(2^k+1)).

Crossrefs

Subsequences (numbers of the form): A030078 (p^3), A050997 (p^5), A030516 (p^6), A179665 (p^9), A030629 (p^10), A030631 (p^12), A065036 (p^3*q), A178740 (p^5*q), A189987 (p^6*q), A179692 (p^9*q), A143610 (p^2*q^3), A179646 (p^5*q^2), A189990 (p^2*q^6), A179702 (p^4*q^5), A179666 (p^4*q^3), A190464 (p^4*q^6), A163569 (p^3*q^2*r), A189975 (p*q*r^3), A190115 (p^2*q^3*r^4), A381315, A048109.

Programs

  • Mathematica
    f[p_, e_] := DigitCount[e, 2, 1] - 1; q[1] = False; q[n_] := Plus @@ f @@@ FactorInteger[n] == 1; Select[Range[500], q]
  • PARI
    isok(k) = vecsum(apply(x -> hammingweight(x) - 1, factor(k)[, 2])) == 1;

A095736 Numbers with binary weight (A000120) <= 3.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 44, 48, 49, 50, 52, 56, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 80, 81, 82, 84, 88, 96, 97, 98, 100, 104, 112, 128, 129, 130, 131, 132, 133, 134, 136
Offset: 1

Views

Author

N. J. A. Sloane, Jun 23 2009

Keywords

Comments

There are O(log^4 x) members of this sequence up to x. - Charles R Greathouse IV, Mar 29 2013

Crossrefs

Programs

Formula

Sum_{n>=2} 1/a(n) = 4.957591106549526542379494338911534917897082748621184321529665450307117309571... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

A129523 Numbers of the form 2^j +- 2^i for 0 <= i < j, in ascending order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 160, 192, 224, 240, 248, 252, 254, 255, 256, 257, 258, 260, 264, 272
Offset: 1

Views

Author

Phil Rutschman (phil(AT)rsnsoft.com), Apr 19 2007

Keywords

Comments

Positive sums and differences of pairs of distinct powers of two, sorted, with duplicates removed.

Examples

			1 = 2^1 - 2^0; 2 = 2^2 - 2^1; 3 = 2^1 + 2^0 or 2^2 - 2^0; 4 = 2^3 - 2^2; 5 = 2^2 + 2^0.
		

Programs

  • Mathematica
    Union[Flatten[Table[{2^n, 2^n - 2^k, 2^n + 2^k}, {n, 8}, {k, 0, n - 1}]]] (* Ivan Neretin, Jul 29 2015 *)
  • Octave
    x=[]; m=12; for i = 0:m; x=[x,2^i-2.^([(i-2):-1:0]),2^i,2^i+2.^([0 :(i-2)])]; end; x

Formula

x(n) = { 2^x - 2^y if x < y }, { 2^x if x = y }, { 2^x + 2^y if x > y} where x = ceiling(sqrt(n)) and y = n - (x-1)^2 - 1.
Union of A018900 and A023758. - M. F. Hasler, Jul 31 2015
Previous Showing 51-60 of 77 results. Next