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.

A050376 "Fermi-Dirac primes": numbers of the form p^(2^k) where p is prime and k >= 0.

Original entry on oeis.org

2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241
Offset: 1

Views

Author

Christian G. Bower, Nov 15 1999

Keywords

Comments

Every number n is a product of a unique subset of these numbers. This is sometimes called the Fermi-Dirac factorization of n (see A182979). Proof: In the prime factorization n = Product_{j>=1} p(j)^e(j) expand every exponent e(j) as binary number and pick the terms of this sequence corresponding to the positions of the ones in binary (it is clear that both n and n^2 have the same number of factors in this sequence, and that each factor appears with exponent 1 or 0).
Or, a(1) = 2; for n>1, a(n) = smallest number which cannot be obtained as the product of previous terms. This is evident from the unique factorization theorem and the fact that every number can be expressed as the sum of powers of 2. - Amarnath Murthy, Jan 09 2002
Except for the first term, same as A084400. - David Wasserman, Dec 22 2004
The least number having 2^n divisors (=A037992(n)) is the product of the first n terms of this sequence according to Ramanujan.
According to the Bose-Einstein distribution of particles, an unlimited number of particles may occupy the same state. On the other hand, according to the Fermi-Dirac distribution, no two particles can occupy the same state (by the Pauli exclusion principle). Unique factorizations of the positive integers by primes (A000040) and over terms of A050376 one can compare with two these distributions in physics of particles. In the correspondence with this, the factorizations over primes one can call "Bose-Einstein factorizations", while the factorizations over distinct terms of A050376 one can call "Fermi-Dirac factorizations". - Vladimir Shevelev, Apr 16 2010
The numbers of the form p^(2^k), where p is prime and k >= 0, might thus be called the "Fermi-Dirac primes", while the classic primes might be called the "Bose-Einstein primes". - Daniel Forgues, Feb 11 2011
In the theory of infinitary divisors, the most natural name of the terms is "infinitary primes" or "i-primes". Indeed, n is in the sequence, if and only if it has only two infinitary divisors. Since 1 and n are always infinitary divisors of n>1, an i-prime has no other infinitary divisors. - Vladimir Shevelev, Feb 28 2011
{a(n)} is the minimal set including all primes and closed with respect to squaring. In connection with this, note that n and n^2 have the same number of factors in their Fermi-Dirac representations. - Vladimir Shevelev, Mar 16 2012
In connection with this sequence, call an integer compact if the factors in its Fermi-Dirac factorization are pairwise coprime. The density of such integers equals (6/Pi^2)*Product_{prime p} (1+(Sum_{i>=1} p^(-(2^i-1))/(p+1))) = 0.872497... It is interesting that there exist only 7 compact factorials listed in A169661. - Vladimir Shevelev, Mar 17 2012
The first k terms of the sequence solve the following optimization problem:
Let x_1, x_2,..., x_k be integers with the restrictions: 2<=x_1A064547(Product{i=1..k} x_i) >= k. Let the goal function be Product_{i=1..k} x_i. Then the minimal value of the goal function is Product_{i=1..k} a(i). - Vladimir Shevelev, Apr 01 2012
From Joerg Arndt, Mar 11 2013: (Start)
Similarly to the first comment, for the sequence "Numbers of the form p^(3^k) or p^(2*3^k) where p is prime and k >= 0" one obtains a factorization into distinct factors by using the ternary expansion of the exponents (here n and n^3 have the same number of such factors).
The generalization to base r would use "Numbers of the form p^(r^k), p^(2*r^k), p^(3*r^k), ..., p^((r-1)*r^k) where p is prime and k >= 0" (here n and n^r have the same number of (distinct) factors). (End)
The first appearance of this sequence as a multiplicative basis in number theory with some new notions, formulas and theorems may have been in my 1981 paper (see the Abramovich reference). - Vladimir Shevelev, Apr 27 2014
Numbers n for which A064547(n) = 1. - Antti Karttunen, Feb 10 2016
Lexicographically earliest sequence of distinct nonnegative integers such that no term is a product of 2 or more distinct terms. Removing the distinctness requirement, the sequence becomes A000040 (the prime numbers); and the equivalent sequence where the product is of 2 distinct terms is A026416 (without its initial term, 1). - Peter Munn, Mar 05 2019
The sequence was independently developed as a multiplicative number system in 1985-1986 (and first published in 1995, see the Uhlmann reference) using a proof method involving representations of positive integers as sums of powers of 2. This approach offers an arguably simpler and more flexible means for analyzing the sequence. - Jeffrey K. Uhlmann, Nov 09 2022

Examples

			Prime powers which are not terms of this sequence:
  8 = 2^3 = 2^(1+2), 27 = 3^3 = 3^(1+2), 32 = 2^5 = 2^(1+4),
  64 = 2^6 = 2^(2+4), 125 = 5^3 = 5^(1+2), 128 = 2^7 = 2^(1+2+4)
"Fermi-Dirac factorizations":
  6 = 2*3, 8 = 2*4, 24 = 2*3*4, 27 = 3*9, 32 = 2*16, 64 = 4*16,
  108 = 3*4*9, 120 = 2*3*4*5, 121 = 121, 125 = 5*25, 128 = 2*4*16.
		

References

  • V. S. Abramovich, On an analog of the Euler function, Proceeding of the North-Caucasus Center of the Academy of Sciences of the USSR (Rostov na Donu) (1981) No. 2, 13-17 (Russian; MR0632989(83a:10003)).
  • S. Ramanujan, Highly Composite Numbers, Collected Papers of Srinivasa Ramanujan, p. 125, Ed. G. H. Hardy et al., AMS Chelsea 2000.
  • V. S. Shevelev, Multiplicative functions in the Fermi-Dirac arithmetic, Izvestia Vuzov of the North-Caucasus region, Nature sciences 4 (1996), 28-43 (in Russian; MR 2000f: 11097, pp. 3912-3913).
  • J. K. Uhlmann, Dynamic map building and localization: new theoretical foundations, Doctoral Dissertation, University of Oxford, Appendix 16, 1995.

Crossrefs

Cf. A000040 (primes, is a subsequence), A026416, A026477, A037992 (partial products), A050377-A050380, A052330, A064547, A066724, A084400, A176699, A182979.
Cf. A268388 (complement without 1).
Cf. A124010, subsequence of A000028, A000961, A213925, A223490.
Cf. A228520, A186945 (Fermi-Dirac analog of Ramanujan primes, A104272, and Labos primes, A080359).
Cf. also A268385, A268391, A268392.

Programs

  • Haskell
    a050376 n = a050376_list !! (n-1)
    a050376_list = filter ((== 1) . a209229 . a100995) [1..]
    -- Reinhard Zumkeller, Mar 19 2013
    
  • Maple
    isA050376 := proc(n)
        local f,e;
        f := ifactors(n)[2] ;
        if nops(f) = 1 then
            e := op(2,op(1,f)) ;
            if isA000079(e) then
                true;
            else
                false;
            end if;
        else
            false;
        end if;
    end proc:
    A050376 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            2 ;
        else
            for a from procname(n-1)+1 do
                if isA050376(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, May 26 2017
  • Mathematica
    nn = 300; t = {}; k = 1; While[lim = nn^(1/k); lim > 2,  t = Join[t, Prime[Range[PrimePi[lim]]]^k]; k = 2 k]; t = Union[t] (* T. D. Noe, Apr 05 2012 *)
  • PARI
    {a(n)= local(m, c, k, p); if(n<=1, 2*(n==1), n--; c=0; m=2; while( cMichael Somos, Apr 15 2005; edited by Michel Marcus, Aug 07 2021
    
  • PARI
    lst(lim)=my(v=primes(primepi(lim)),t); forprime(p=2,sqrt(lim),t=p; while((t=t^2)<=lim,v=concat(v,t))); vecsort(v) \\ Charles R Greathouse IV, Apr 10 2012
    
  • PARI
    is_A050376(n)=2^#binary(n=isprimepower(n))==n*2 \\ M. F. Hasler, Apr 08 2015
    
  • PARI
    ispow2(n)=n && n>>valuation(n,2)==1
    is(n)=ispow2(isprimepower(n)) \\ Charles R Greathouse IV, Sep 18 2015
    
  • PARI
    isok(n)={my(e=isprimepower(n)); e && !bitand(e,e-1)} \\ Andrew Howroyd, Oct 16 2024
    
  • Python
    from sympy import isprime, perfect_power
    def ok(n):
      if isprime(n): return True
      answer = perfect_power(n)
      if not answer: return False
      b, e = answer
      if not isprime(b): return False
      while e%2 == 0: e //= 2
      return e == 1
    def aupto(limit):
      alst, m = [], 1
      for m in range(1, limit+1):
        if ok(m): alst.append(m)
      return alst
    print(aupto(241)) # Michael S. Branicky, Feb 03 2021
    
  • Python
    from sympy import primepi, integer_nthroot
    def A050376(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(primepi(integer_nthroot(x,1<Chai Wah Wu, Feb 18-19 2025
  • Scheme
    (define A050376 (MATCHING-POS 1 1 (lambda (n) (= 1 (A064547 n)))))
    ;; Requires also my IntSeq-library. - Antti Karttunen, Feb 09 2016
    

Formula

From Vladimir Shevelev, Mar 16 2012: (Start)
Product_{i>=1} a(i)^k_i = n!, where k_i = floor(n/a(i)) - floor(n/a(i)^2) + floor(n/a(i)^3) - floor(n/a(i)^4) + ...
Denote by A(x) the number of terms not exceeding x.
Then A(x) = pi(x) + pi(x^(1/2)) + pi(x^(1/4)) + pi(x^(1/8)) + ...
Conversely, pi(x) = A(x) - A(sqrt(x)). For example, pi(37) = A(37) - A(6) = 16-4 = 12. (End)
A209229(A100995(a(n))) = 1. - Reinhard Zumkeller, Mar 19 2013
From Vladimir Shevelev, Aug 31 2013: (Start)
A Fermi-Dirac analog of Euler product: Zeta(s) = Product_{k>=1} (1+a(k)^(-s)), for s > 1.
In particular, Product_{k>=1} (1+a(k)^(-2)) = Pi^2/6. (End)
a(n) = A268385(A268392(n)). [By their definitions.] - Antti Karttunen, Feb 10 2016
A000040 union A001248 union A030514 union A179645 union A030635 union .... - R. J. Mathar, May 26 2017

Extensions

Edited by Charles R Greathouse IV, Mar 17 2010
More examples from Daniel Forgues, Feb 09 2011

A000028 Let k = p_1^e_1 p_2^e_2 p_3^e_3 ... be the prime factorization of n. Sequence gives k such that the sum of the numbers of 1's in the binary expansions of e_1, e_2, e_3, ... is odd.

Original entry on oeis.org

2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 24, 25, 29, 30, 31, 37, 40, 41, 42, 43, 47, 49, 53, 54, 56, 59, 60, 61, 66, 67, 70, 71, 72, 73, 78, 79, 81, 83, 84, 88, 89, 90, 96, 97, 101, 102, 103, 104, 105, 107, 108, 109, 110, 113, 114, 121, 126, 127, 128, 130, 131, 132, 135, 136, 137
Offset: 1

Views

Author

Keywords

Comments

This sequence and A000379 (its complement) give the unique solution to the problem of splitting the positive integers into two classes in such a way that products of pairs of distinct elements from either class occur with the same multiplicities [Lambek and Moser]. Cf. A000069, A001969.
Contains (for example) 180, so is different from A123193. - Max Alekseyev, Sep 20 2007
The sequence contains products of odd number of distinct terms of A050376. - Vladimir Shevelev, May 04 2010
From Vladimir Shevelev, Oct 28 2013: (Start)
Numbers m such that infinitary Moebius function of m (A064179) equals -1. This follows from the definition of A064179.
Number m is in the sequence if and only if the number k = k(m) of terms of A050376 which divide m with odd maximal exponent is odd.
For example, if m = 96, then the maximal exponent of 2 that divides 96 is 5, for 3 it is 1, for 4 it is 2, for 16 it is 1. Thus k(96) = 3 and 96 is a term.
(End)
Positions of odd terms in A064547, A268386 and A293439. - Antti Karttunen, Nov 09 2017
Lexicographically earliest sequence of distinct nonnegative integers such that no term is the A059897 product of 2 terms. (A059897 can be considered as a multiplicative operator related to the Fermi-Dirac factorization of numbers described in A050376.) Specifying that the A059897 product be of 2 distinct terms leaves the sequence unchanged. The equivalent sequences using standard integer multiplication are A026416 (with the 2 terms specified as distinct) and A026424 (otherwise). - Peter Munn, Mar 16 2019
From Amiram Eldar, Oct 02 2024: (Start)
Numbers whose number of infinitary divisors (A037445) is not a square.
Numbers whose exponentially odious part (A367514) has an odd number of distinct prime factors, i.e., numbers k such that A092248(A367514(k)) = 1. (End)

Examples

			If k = 96 then the maximal exponent of 2 that divides 96 is 5, for 3 it is 1. 5 in binary is 101_2 and has so has a sum of binary digits of 1 + 0 + 1 = 2. 1 in binary is 1_2 and so has a sum of binary digits of 1. Thus the sum of digits of binary exponents is 2 + 1 = 3 which is odd and so 96 is a term. - _Vladimir Shevelev_, Oct 28 2013, edited by _David A. Corneth_, Mar 20 2019
		

References

  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 22.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A133008, A000379 (complement), A000120 (binary weight function), A064547; also A066724, A026477, A050376, A084400, A268386, A293439.
Note that A000069 and A001969, also A000201 and A001950 give other decompositions of the integers into two classes.
Cf. A124010 (prime exponents).

Programs

  • Haskell
    a000028 n = a000028_list !! (n-1)
    a000028_list = filter (odd . sum . map a000120 . a124010_row) [1..]
    -- Reinhard Zumkeller, Oct 05 2011
    
  • Maple
    (Maple program from N. J. A. Sloane, Dec 20 2007) expts:=proc(n) local t1,t2,t3,t4,i; if n=1 then RETURN([0]); fi; if isprime(n) then RETURN([1]); fi; t1:=ifactor(n); if nops(factorset(n))=1 then RETURN([op(2,t1)]); fi; t2:=nops(t1); t3:=[]; for i from 1 to t2 do t4:=op(i,t1); if nops(t4) = 1 then t3:=[op(t3),1]; else t3:=[op(t3),op(2,t4)]; fi; od; RETURN(t3); end; # returns a list of the exponents e_1, e_2, ...
    A000120 := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: # returns weight of binary expansion
    LamMos:= proc(n) local t1,t2,t3,i; t1:=expts(n); add( A000120(t1[i]),i=1..nops(t1)); end; # returns sum of weights of exponents
    M:=400; t0:=[]; t1:=[]; for n from 1 to M do if LamMos(n) mod 2 = 0 then t0:=[op(t0),n] else t1:=[op(t1),n]; fi; od: t0; t1; # t0 is A000379, t1 is the present sequence
  • Mathematica
    iMoebiusMu[ n_ ] := Switch[ MoebiusMu[ n ], 1, 1, -1, -1, 0, If[ OddQ[ Plus@@ (DigitCount[ Last[ Transpose[ FactorInteger[ n ] ] ], 2, 1 ]) ], -1, 1 ] ]; q=Select[ Range[ 20000 ],iMoebiusMu[ # ]===-1& ] (* Wouter Meeussen, Dec 21 2007 *)
    Rest[Select[Range[150],OddQ[Count[Flatten[IntegerDigits[#,2]&/@ Transpose[ FactorInteger[#]][[2]]],1]]&]] (* Harvey P. Dale, Feb 25 2012 *)
  • PARI
    is(n)=my(f=factor(n)[,2]); sum(i=1,#f,hammingweight(f[i]))%2 \\ Charles R Greathouse IV, Aug 31 2013

Extensions

Entry revised by N. J. A. Sloane, Dec 20 2007, restoring the original definition, correcting the entries and adding a new b-file.

A026477 a(1) = 1, a(2) = 2, a(3) = 3; and for n > 3, a(n) = smallest number > a(n-1) and not of the form a(i)*a(j)*a(k) for 1 <= i < j < k < n.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 120, 121, 127, 131, 137, 139, 149, 151, 157, 163, 167, 168, 169, 173, 179, 181, 191, 193, 197, 199, 210, 211, 216, 223
Offset: 1

Views

Author

Keywords

Comments

From Bob Selcoe, Aug 25 2016: (Start)
Once a term with a given prime signature S (i.e., multiset of prime exponents) appears, then all numbers with the same prime signature follow. So either all or no terms with the same prime signature appear (first conjectured by Charles R Greathouse IV).
Proof:
i. Let S = {i,j,k..,y}, i>=j>=k.. be prime signatures, i.e., numbers of the form (p^i*q^j*r^k..*z^y) where {p,q,r,..,z} are distinct primes; denote S = {} as the signature for p^0 = 1.
ii. By definition, 1 and all primes p appear in the sequence; so terms where S = {k} (i.e., one-digit signatures denoting prime powers p^k) are k=0 and k = A026474(n) = {1,2,4,8,15,22,29..}, because k cannot be the sum of any combination of 3 smaller k. So the only prime power terms are p^0 = 1 and p^A026474(n), or S = {}, {1}, {2}, {4}, {8}, {15}, {22}, {29}...
iii. By induction, once S = {k} is determined, all other terms with the same prime signature appear (or do not) depending on the various combinations of signature exponents of previous terms with smaller signature sums. So for example, terms with the same two-digit signature S = {k,k} (i.e. (pq)^k) are constrained by the following: since p = {1} and q = {1} appear, then (pq) = {1,1} does not because in this case {1}*{1}*{} = {1,1}; since p^2 = {2} and q^2 = {2} appear, then (pq)^2 = {2,2} does not; since {4} appears but {3} does not, then {3,3} appears but {4,4} and {5,5} do not (the latter because {3,3}*{2}*{2} = {5,5} when p^2,q^2 = {2}). Note that {3,3} would not appear if {3,2} appeared because {3,2}*{1}*{} = {3,3} when q = {1}; but because p = {1} and p^2,q^2 = {2} appear, then {2}*{2}*{1} = {3,2} does not. {6,6} does not appear because {6,5} appears (by virtue of other constraints) and {6,5}*{1}*{} = {6,6} when q = {1}. Determining which signatures appear and which do not becomes increasingly complicated as the sequence increases.
Don Reble offered a proof on the Sequence Fans Mailing List which seems to be different (and certainly more formal) than mine. Perhaps mine is more of an "explanation" than a "proof"? (End)

Crossrefs

There are six related sequences: A026477: 1 <= i < j < k < n starting 1,2,3; A026478: 1 <= i <= j <= k < n starting 1,2,3; A026479: 1 <= i < j < k < n starting 1,2,4; A026480: 1 <= i <= j <= k < n starting 1,2,4; A026481: 1 <= i < j < k < n starting 1,3,4; A026482: 1 <= i <= j <= k < n starting 1,3,4.

Programs

  • Mathematica
    a = {1, 2, 3}; no = {1 2 3};
    Do[x = SelectFirst[Range[Last[a] + 1, 1000], ! MemberQ[no, #] &]; AppendTo[a, x]; no = Union[Times @@@ Subsets[a, {3}]], 200]; a (* Robert Price, May 26 2019 *)
  • PARI
    list(lim)=my(v=List(),n,d,k); while(n++<=lim, d=divisors(n); for(i=1,#d-2, if(!setsearch(v,d[i]), next); for(j=i+1,#d-1, if(!setsearch(v,d[j]), next); k=n/(d[i]*d[j]); if(d[j]>=k, break); if(denominator(k)==1 && setsearch(v,k), next(3)))); listput(v,n)); Vec(v) \\ Charles R Greathouse IV, Sep 16 2015

Extensions

More terms from Christian G. Bower, Nov 15 1999

A026416 A 2-way classification of integers: a(1) = 1, a(2) = 2 and for n > 2, a(n) is the smallest number not of the form a(i)*a(j) for 1 <= i < j < n.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 24, 25, 29, 30, 31, 37, 40, 41, 42, 43, 47, 49, 53, 54, 56, 59, 61, 66, 67, 70, 71, 73, 78, 79, 81, 83, 88, 89, 97, 101, 102, 103, 104, 105, 107, 109, 110, 113, 114, 121, 127, 128, 130, 131, 135, 136, 137, 138, 139
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition is: a(1) = 1, a(2) = 2; and for n > 2, a(n) = least positive integer > a(n-1) and not of the form a(i)*a(j) for 1 <= i < j < n.
a(2) to a(29) match the initial terms of A000028. [corrected by Peter Munn, Mar 15 2019]
This has a simpler definition than A000028, but the resulting pair lacks the crucial property of the A000028/A000379 pair (see the comment in A000028). - N. J. A. Sloane, Sep 28 2007
Contains (for example) 180, so is different from A123193. - Max Alekseyev, Sep 20 2007
From Vladimir Shevelev, Apr 05 2013: (Start)
1) The sequence does not contain (for example) 140, so is different from A000028.
2) Representation of numbers which are absent in the sequence as a product of two different terms of the sequence is, generally speaking, not unique. For example, 210 = 2*105 = 3*70 = 5*42 = 7*30.
(End)
Excluding a(1) = 1, the lexicographically earliest sequence of distinct nonnegative integers such that no term is a product of 2 distinct terms. Removing the latter distinctness requirement, the sequence becomes A026424; and the equivalent sequence where the product is of 2 or more distinct terms is A050376. A000028 is similarly the equivalent sequence when A059897 is used as multiplicative operator in place of standard integer multiplication. - Peter Munn, Mar 15 2019

Examples

			a(8) is not 10 because we already have 10 = 2*5. Of course all primes appear. 16 appears because 16 is not a product of earlier terms.
		

Crossrefs

Complement of A131181. Cf. A000028, A059897.
Similar sequences with different starting conditions: A026417 (1,3), A026419 (1,4), A026420 (2,4), A026421 (3,4).
Related sequences with definition using any products (not necessarily distinct) and with various starting conditions: A026422 (1,2),A026423 (1,3), A026424 (2,3), A026425 (1,4), A026426 (2,4), A026427 (3,4).
See also families of related sequences: A026431 (excluding product-1), A026443 (excluding product+2), A026453 (excluding product-2) and references therein.

Programs

  • Mathematica
    a[1]=1; a[2]=2; a[n_] := a[n] = For[k = a[n-1] + 1, True, k++, If[ FreeQ[ Table[ a[i]*a[j], {i, 1, n-2}, {j, i+1, n-1}], k], Return[k]]]; Table[a[n], {n, 1, 101}] (* Jean-François Alcover, May 16 2013 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        a, products = [1, 2], {2}
        yield from a
        for k in count(3):
            if k not in products:
                yield k
                products.update(k*a[i] for i in range(len(a)))
                a.append(k)
            products.discard(k)
    print(list(islice(agen(), 62))) # Michael S. Branicky, Jun 09 2025

Extensions

More terms from Max Alekseyev, Sep 23 2007
Edited by N. J. A. Sloane, Jul 13 2008 at the suggestion of R. J. Mathar and Max Alekseyev

A066720 The greedy rational packing sequence: a(1) = 1; for n > 1, a(n) is smallest number such that the ratios a(i)/a(j) for 1 <= i < j <= n are all distinct.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 11, 13, 17, 18, 19, 23, 29, 31, 37, 41, 43, 47, 50, 53, 59, 60, 61, 67, 71, 73, 79, 81, 83, 89, 97, 98, 101, 103, 105, 107, 109, 113, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

N. J. A. Sloane, Jan 15 2002

Keywords

Comments

Sequence was apparently invented by Jeromino Wannhoff - see the Rosenthal link.
An equivalent definition: a(1) = 1, a(2) = 2 and thereafter a(n) is the smallest number such that all a(i)*a(j) are different. - Thanks to Jean-Paul Delahaye for this comment. - N. J. A. Sloane, Oct 01 2020
If you replace the word "ratio" with "difference" and start from 1 using the same greedy algorithm you get A005282. - Sharon Sela (sharonsela(AT)hotmail.com), Jan 15 2002
Taking a(n) as the smallest number such that the pairwise sums a(i)+a(j) (iA011185. - Jean-Paul Delahaye, Oct 02 2020. [This replaces an incorrect comment.]
Does every rational number appear as a ratio? See A066657, A066658.
Contains all primes. Differs from A066724 in that the latter forbids only the products of distinct terms. - Ivan Neretin, Mar 02 2016

Examples

			After 5, 7 is the next member and not 6 as 6*1 = 2*3.
		

Crossrefs

Consists of the primes together with A066721.
For the rationals that are produced see A066657/A066658 and A066848, A066849.

Programs

  • Haskell
    import qualified Data.Set as Set (null)
    import Data.Set as Set (empty, insert, member)
    a066720 n = a066720_list !! (n-1)
    a066720_list = f [] 1 empty where
       f ps z s | Set.null s' = f ps (z + 1) s
                | otherwise   = z : f (z:ps) (z + 1) s'
         where s' = g (z:ps) s
               g []     s                      = s
               g (x:qs) s | (z * x) `member` s = empty
                          | otherwise          = g qs $ insert (z * x) s
    -- Reinhard Zumkeller, Nov 19 2013
  • Maple
    A[1]:= 1:
    F:= {1}:
    for n from 2 to 100 do
    for k from A[n-1]+1 do
    Fk:= {k^2, seq(A[i]*k,i=1..n-1)};
    if Fk intersect F = {} then
    A[n]:= k;
    F:= F union Fk;
    break
    fi
    od
    od:
    seq(A[i],i=1..100); # Robert Israel, Mar 02 2016
  • Mathematica
    s={1}; xok := Module[{}, For[i=1, i<=n, i++, For[j=1; k=Length[dl=Divisors[s[[i]]x]], j<=k, j++; k--, If[MemberQ[s, dl[[j]]]&&MemberQ[s, dl[[k]]], Return[False]]]]; True]; For[n=1, True, n++, Print[s[[n]]]; For[x=s[[n]]+1, True, x++, If[xok, AppendTo[s, x]; Break[]]]] (* Dean Hickerson *)
    a[1] = 1; a[n_] := a[n] = Block[{k = a[n - 1] + 1, b = c = Table[a[i], {i, 1, n - 1}], d}, While[c = Append[b, k]; Length[ Union[ Flatten[ Table[ c[[i]]/c[[j]], {i, 1, n}, {j, 1, n}]]]] != n^2 - n + 1, k++ ]; Return[k]]; Table[ a[n], {n, 1, 75} ] (* Robert G. Wilson v *)
    nmax = 100; a[1] = 1; F = {1};
    For[n = 2, n <= nmax, n++,
    For[k = a[n-1]+1, True, k++, Fk = Join[{k^2}, Table[a[i]*k, {i, 1, n-1}]] // Union; If[Fk ~Intersection~ F == {}, a[n] = k; F = F ~Union~ Fk; Break[]
    ]]];
    Array[a, nmax] (* Jean-François Alcover, Mar 26 2019, after Robert Israel *)
  • PARI
    {a066720(m) = local(a,rat,n,s,new,b,i,k,j); a=[]; rat=Set([]); n=0; s=0; while(sKlaus Brockhaus, Feb 23 2002
    

Extensions

More terms from Dean Hickerson, Klaus Brockhaus and David Applegate, Jan 15 2002
Entry revised by N. J. A. Sloane, Oct 01 2020.

A084400 a(1) = 1; for n>1, a(n) = smallest number that does not divide the product of all previous terms.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 25, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Amarnath Murthy, May 31 2003

Keywords

Comments

All numbers of the form p^(2^k) are members.
Except for the first term, same as A050376. - David Wasserman, Dec 22 2004
Also, the lexicographically earliest sequence of distinct positive integers such that the number of divisors of the product of n initial terms (for any n) is a power of 2. - Ivan Neretin, Aug 12 2015

Crossrefs

Programs

  • PARI
    find(pv)=k = 1; while (! (pv % k), k++); return (k);
    lista(nn) = print1(pv=1, ", "); for (i=1, nn, nv = find(pv); pv *= nv; print1(nv, ", ")) \\ Michel Marcus, Aug 12 2015
    
  • PARI
    A209229(n)=if(n%2, n==1, isprimepower(n))
    is(n)=A209229(isprimepower(n)) || n==1 \\ Charles R Greathouse IV, Oct 19 2015
    
  • Python
    from sympy import primepi, integer_nthroot
    def A084400(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n-1+x-sum(primepi(integer_nthroot(x,1<Chai Wah Wu, Mar 25 2025

Extensions

More terms from Patrick De Geest, Jun 05 2003

A360613 Lexicographically earliest sequence of positive integers such that the products of the form a(2*u-1) * a(2*v) with u, v > 0 are all distinct.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 15, 14, 17, 18, 19, 23, 24, 25, 29, 26, 31, 28, 33, 36, 37, 41, 40, 43, 47, 46, 49, 50, 51, 52, 53, 59, 55, 61, 57, 63, 64, 67, 71, 73, 79, 81, 83, 82, 85, 86, 87, 88, 89, 91, 93, 92, 95, 97, 101, 100, 103, 107, 109, 113, 111
Offset: 1

Views

Author

Rémy Sigrist, Feb 14 2023

Keywords

Comments

In other words, the products of a term from the odd bisection by a term from the even bisection are all distinct.
If we consider the bitwise XOR operator instead of the multiplication then we obtain A000695 interleaved with A062880.
The value 1 is the only duplicate.
All prime numbers appear in this sequence, in ascending order.
For n = 1..50000, if m_n denotes the least positive value not in {a(2*u-1) * a(2*v), 1 <= 2*u-1 <= n and 1 <= 2*v <= n}, then a(n+1) = m_n or a(n+2) = m_n. Will this pattern last forever?

Examples

			The first terms, alongside the corresponding products, are:
  n   a(n)  Corresponding products
  --  ----  --------------------------
   1     1
   2     1   1
   3     2   2
   4     3   3,  6
   5     4   4, 12
   6     5   5, 10, 20
   7     7   7, 21, 35
   8     8   8, 16, 32,  56
   9     9   9, 27, 45,  72
  10    11  11, 22, 44,  77,  99
  11    13  13, 39, 65, 104, 143
  12    15  15, 30, 60, 105, 135, 195
		

Crossrefs

Cf. A000695, A062880, A066724, A360627-A360628 (bisections), A360633 (products).

Programs

  • C
    See Links section.

Formula

a(n) < a(n+2).

A080431 Even numbers such that all a(i)*a(j) are distinct.

Original entry on oeis.org

2, 4, 6, 8, 10, 14, 18, 22, 26, 32, 34, 38, 46, 50, 58, 60, 62, 74, 82, 86, 94, 98, 106, 118, 122, 134, 142, 146, 158, 162, 166, 168, 178, 194, 202, 206, 214, 218, 226, 242, 254, 256, 262, 274, 278, 298, 302, 308, 314, 326, 334, 338, 346, 358, 360, 362, 382, 386
Offset: 1

Views

Author

Amarnath Murthy, Feb 20 2003

Keywords

Crossrefs

Equals 2*A066724.

Programs

  • Maple
    S := {8}: A := array(1..10^3): for m from 1 to 10^3 do A[m] := 0 od: A[2] := 2: A[4] := 4: for n from 6 to 10^3 by 2 do mytest := 0: for j from 2 to n-2 by 2 do if A[j]>0 then if member(A[j]*n, S) then mytest := 1; break; fi: fi: od: if mytest=0 then A[n] := n; for j from 2 to n-2 by 2 do S := S union {A[j]*n} od: fi: od: for i from 2 to 10^3 by 2 do if A[i]>0 then printf(`%d,`, A[i]) fi: od: # James Sellers, Feb 26 2003

Extensions

More terms from James Sellers, Feb 26 2003
Showing 1-8 of 8 results.