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

A251724 a(1) = 2, and for n>1: a(n) = prime(A251719(n)) * prime(A251719(n) + n - 2), where prime(n) gives the n-th prime.

Original entry on oeis.org

2, 4, 6, 21, 65, 85, 95, 115, 217, 259, 287, 301, 329, 649, 671, 737, 781, 803, 869, 913, 979, 1067, 1111, 1133, 1177, 1199, 1243, 1703, 1781, 1807, 1937, 1963, 2041, 2119, 2171, 3043, 3077, 3247, 3281, 3349, 3383, 3587, 3791, 3859, 3893, 3961, 4063, 4097, 4267, 4369, 4471, 4573, 4607, 4709, 4777, 4811, 5833, 5909, 5947, 6023, 6289, 6403, 6593, 6631, 6707, 6821, 8579
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Comments

For n >= 2: a(n) = the first "settled semiprime" in the column n of the sieve of Eratosthenes: a(n) = A083221(A251719(n), n).
The "settling of semiprimes" here means that from that semiprime onward, all the other terms in the same column n of a square array A083221 (which is constructed from the sieve of Eratosthenes) are also semiprimes, obtained by successive iterations of A003961 starting from the semiprime here given as a(n). Cf. comments in A251728 which contains all such semiprimes. The "unsettled" semiprimes are in its complement A138511.
Here we assume that A054272(n), the number of primes in interval [prime(n), prime(n)^2], is nondecreasing (implied for example if Legendre's or Brocard's conjecture is true).

Crossrefs

After initial 2, a subsequence of A251728 and A001358.

Formula

a(1) = 2; and for n >= 2: a(n) = A000040(A251719(n)) * A000040(A251719(n) + n - 2).
a(n) = A083221(A251719(n), n).
Other identities implied by the definition. For all n >= 1:
A078898(a(n)) = n.
A055396(a(n)) = A251719(n).
For all n >= 2:
A243055(a(n)) = n-2.

A078898 Number of times the smallest prime factor of n is the smallest prime factor for numbers <= n; a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 4, 11, 1, 12, 2, 13, 5, 14, 1, 15, 1, 16, 6, 17, 3, 18, 1, 19, 7, 20, 1, 21, 1, 22, 8, 23, 1, 24, 2, 25, 9, 26, 1, 27, 4, 28, 10, 29, 1, 30, 1, 31, 11, 32, 5, 33, 1, 34, 12, 35, 1, 36, 1, 37, 13, 38, 3, 39, 1, 40, 14, 41, 1, 42, 6, 43
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 12 2002

Keywords

Comments

From Antti Karttunen, Dec 06 2014: (Start)
For n >= 2, a(n) tells in which column of the sieve of Eratosthenes (see A083140, A083221) n occurs in. A055396 gives the corresponding row index.
(End)

Crossrefs

Programs

  • Haskell
    import Data.IntMap (empty, findWithDefault, insert)
    a078898 n = a078898_list !! n
    a078898_list = 0 : 1 : f empty 2 where
       f m x = y : f (insert p y m) (x + 1) where
               y = findWithDefault 0 p m + 1
               p = a020639 x
    -- Reinhard Zumkeller, Apr 06 2015
  • Maple
    N:= 1000: # to get a(0) to a(N)
    Primes:= select(isprime, [2,seq(2*i+1,i=1..floor((N-1)/2))]):
    A:= Vector(N):
    for p in Primes do
      t:= 1:
      A[p]:= 1:
      for n from p^2 to N by p do
        if A[n] = 0 then
           t:= t+1:
           A[n]:= t
        fi
      od
    od:
    0,1,seq(A[i],i=2..N); # Robert Israel, Jan 04 2015
  • Mathematica
    Module[{nn=90,spfs},spfs=Table[FactorInteger[n][[1,1]],{n,nn}];Table[ Count[ Take[spfs,i],spfs[[i]]],{i,nn}]] (* Harvey P. Dale, Sep 01 2014 *)
  • PARI
    \\ Not practical for computing, but demonstrates the sum moebius formula:
    A020639(n) = { if(1==n,n,vecmin(factor(n)[, 1])); };
    A055396(n) = { if(1==n,0,primepi(A020639(n))); };
    A002110(n) = prod(i=1, n, prime(i));
    A078898(n) = { my(k,p); if(1==n, n, k = A002110(A055396(n)-1); p = A020639(n); sumdiv(k, d, moebius(d)*(n\(p*d)))); };
    \\ Antti Karttunen, Dec 05 2014
    
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A078898 n) (if (< n 2) n (+ 1 (A078898 (A249744 n)))))
    ;; Much better for computing. Needs also code from A249738 and A249744. - Antti Karttunen, Dec 06 2014
    

Formula

Ordinal transform of A020639 (Lpf). - Franklin T. Adams-Watters, Aug 28 2006
From Antti Karttunen, Dec 05-08 2014: (Start)
a(0) = 0, a(1) = 1, a(n) = 1 + a(A249744(n)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(n / (A020639(n)*d)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(A032742(n) / d).
[Instead of Moebius mu (A008683) one could use Liouville's lambda (A008836) in the above formulas, because all primorials (A002110) are squarefree. A020639(n) gives the smallest prime dividing n, and A055396 gives its index].
a(0) = 0, a(1) = 1, a(2n) = n, a(2n+1) = a(A250470(2n+1)). [After a similar recursive formula for A246277. However, this cannot be used for computing the sequence, unless a definition for A250470(n) is found which doesn't require computing the value of A078898(n).]
For n > 1: a(n) = A249810(n) - A249820(n).
(End)
Other identities:
a(2*n) = n.
For n > 1: a(n)=1 if and only if n is prime.
For n > 1: a(n) = A249808(n, A055396(n)) = A249809(n, A055396(n)).
For n > 1: a(n) = A246277(A249818(n)).
From Antti Karttunen, Jan 04 2015: (Start)
a(n) = 2 if and only if n is a square of a prime.
For all n >= 1: a(A251728(n)) = A243055(A251728(n)) + 2. That is, if n is a semiprime of the form prime(i)*prime(j), prime(i) <= prime(j) < prime(i)^2, then a(n) = (j-i)+2.
(End)
a(A000040(n)^2) = 2; a(A000040(n)*A000040(n+1)) = 3. - Reinhard Zumkeller, Apr 06 2015
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{k>=1} (A038110(k)/A038111(k))^2 = 0.2847976823663... . - Amiram Eldar, Oct 26 2024

Extensions

a(0) = 0 prepended for recurrence's sake by Antti Karttunen, Dec 06 2014

A083221 Sieve of Eratosthenes arranged as an array and read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

2, 4, 3, 6, 9, 5, 8, 15, 25, 7, 10, 21, 35, 49, 11, 12, 27, 55, 77, 121, 13, 14, 33, 65, 91, 143, 169, 17, 16, 39, 85, 119, 187, 221, 289, 19, 18, 45, 95, 133, 209, 247, 323, 361, 23, 20, 51, 115, 161, 253, 299, 391, 437, 529, 29, 22, 57, 125, 203, 319, 377, 493, 551, 667
Offset: 2

Views

Author

Yasutoshi Kohmoto, Jun 05 2003

Keywords

Comments

This is permutation of natural numbers larger than 1.
From Antti Karttunen, Dec 19 2014: (Start)
If we assume here that a(1) = 1 (but which is not explicitly included because outside of the array), then A252460 gives an inverse permutation. See also A249741.
For navigating in this array:
A055396(n) gives the row number of row where n occurs, and A078898(n) gives its column number, both starting their indexing from 1.
A250469(n) gives the number immediately below n, and when n is an odd number >= 3, A250470(n) gives the number immediately above n. If n is a composite, A249744(n) gives the number immediately left of n.
First cube of each row, which is {the initial prime of the row}^3 and also the first number neither a prime or semiprime, occurs on row n at position A250474(n).
(End)
The n-th row contains the numbers whose least prime factor is the n-th prime: A020639(T(n,k)) = A000040(n). - Franklin T. Adams-Watters, Aug 07 2015

Examples

			The top left corner of the array:
   2,   4,   6,    8,   10,   12,   14,   16,   18,   20,   22,   24,   26
   3,   9,  15,   21,   27,   33,   39,   45,   51,   57,   63,   69,   75
   5,  25,  35,   55,   65,   85,   95,  115,  125,  145,  155,  175,  185
   7,  49,  77,   91,  119,  133,  161,  203,  217,  259,  287,  301,  329
  11, 121, 143,  187,  209,  253,  319,  341,  407,  451,  473,  517,  583
  13, 169, 221,  247,  299,  377,  403,  481,  533,  559,  611,  689,  767
  17, 289, 323,  391,  493,  527,  629,  697,  731,  799,  901, 1003, 1037
  19, 361, 437,  551,  589,  703,  779,  817,  893, 1007, 1121, 1159, 1273
  23, 529, 667,  713,  851,  943,  989, 1081, 1219, 1357, 1403, 1541, 1633
  29, 841, 899, 1073, 1189, 1247, 1363, 1537, 1711, 1769, 1943, 2059, 2117
  ...
		

Crossrefs

Transpose of A083140.
One more than A249741.
Inverse permutation: A252460.
Column 1: A000040, Column 2: A001248.
Row 1: A005843, Row 2: A016945, Row 3: A084967, Row 4: A084968, Row 5: A084969, Row 6: A084970.
Main diagonal: A083141.
First semiprime in each column occurs at A251717; A251718 & A251719 with additional criteria. A251724 gives the corresponding semiprimes for the latter. See also A251728.
Permutations based on mapping numbers between this array and A246278: A249817, A249818, A250244, A250245, A250247, A250249. See also: A249811, A249814, A249815.
Also used in the definition of the following arrays of permutations: A249821, A251721, A251722.

Programs

  • Mathematica
    lim = 11; a = Table[Take[Prime[n] Select[Range[lim^2], GCD[# Prime@ n, Product[Prime@ i, {i, 1, n - 1}]] == 1 &], lim], {n, lim}]; Flatten[Table[a[[i, n - i + 1]], {n, lim}, {i, n}]] (* Michael De Vlieger, Jan 04 2016, after Yasutoshi Kohmoto at A083140 *)

Extensions

More terms from Hugo Pfoertner, Jun 13 2003

A050216 Number of primes between (prime(n))^2 and (prime(n+1))^2, with a(0) = 2 by convention.

Original entry on oeis.org

2, 2, 5, 6, 15, 9, 22, 11, 27, 47, 16, 57, 44, 20, 46, 80, 78, 32, 90, 66, 30, 106, 75, 114, 163, 89, 42, 87, 42, 100, 354, 99, 165, 49, 299, 58, 182, 186, 128, 198, 195, 76, 356, 77, 144, 75, 463, 479, 168, 82, 166, 270, 90, 438, 275, 274, 292, 91, 292, 199, 99
Offset: 0

Views

Author

Keywords

Comments

The function in Brocard's Conjecture, which states that for n >= 2, a(n) >= 4.
The lines in the graph correspond to prime gaps of 2, 4, 6, ... . - T. D. Noe, Feb 04 2008
Lengths of blocks of consecutive primes in A000430 (union of primes and squares of primes). - Reinhard Zumkeller, Sep 23 2011
In the n-th step of the sieve of Eratosthenes, all multiples of prime(n) are removed. Then a(n) gives the number of new primes obtained after the n-th step. - Jean-Christophe Hervé, Oct 27 2013
More precisely, after the n-th step, one is sure to have eliminated all composites less than prime(n+1)^2, since any composite N has a prime factor <= sqrt(N). It is in exactly this (restricted) sense that a(n) yields the number of "new primes" (additional numbers known to be prime) after the n-th step. But one knows after the n-th step also that all remaining numbers between prime(n+1)^2 and prime(n+1)*(prime(n+1)+2) are prime: By construction they don't have a factor less than prime(n+1) and they don't have a factor prime(n+1) so the least prime factor could be prime(n+2) >= prime(n+1)+2. For example, after eliminating multiples of 3 in the 2nd step, one has (2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 31, 35, ...) and one knows that all remaining numbers strictly in between 5^2=25 and 5*(5+2)=35 are prime, too. - M. F. Hasler, Dec 31 2014
Numerically, the slope of the lowest "ray" m(n) = min {a(k); k>n}, seems to converge to a value somewhere in the range 1.75 < m(n)/n < 1.8; with m(n)/n > 1.7 for n > 900, m(n)/n > 1.75 for n > 2700. - M. F. Hasler, Dec 31 2014
Legendre's conjecture (see A014085) would imply that a(n) >= 2 for all n and that sequences A054272, A250473 and A250474 were thus strictly increasing (see the Wikipedia article about Brocard's conjecture). - Antti Karttunen, Jan 01 2015
a(n) >= 4 up to at least n = 4*10^5. - Eric W. Weisstein, Jan 13 2025

Examples

			There are 2 primes less than 2^2, there are 2 primes between 2^2 and 3^2, 5 primes between 3^2 and 5^2, etc. [corrected by Jonathan Sperry, Aug 30 2013]
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 183.

Crossrefs

First differences of A000879.
One more than A251723.
Cf. A380135 (High water marks for number of primes between prime(n)^2 and prime(n+1)^2).
Cf. A380136 (Positions of the high water marks for number of primes between prime(n)^2 and prime(n+1)^2).

Programs

  • Haskell
    import Data.List (group)
    a050216 n = a050216_list !! (n-1)
    a050216_list =
       map length $ filter (/= [0]) $ group $ map a010051 a000430_list
    -- Reinhard Zumkeller, Sep 23 2011
    
  • Maple
    A050216 := proc(n)
        local p,pn ;
        if n = 0 then
            2;
        else
            p := ithprime(n) ;
            pn := nextprime(p) ;
            numtheory[pi](pn^2)-numtheory[pi](p^2) ;
        end if;
    end proc:
    seq(A050216(n),n=0..40) ; # R. J. Mathar, Jan 27 2025
  • Mathematica
    -Subtract @@@ Partition[PrimePi[Prime[Range[20]]^2], 2, 1] (* Eric W. Weisstein, Jan 10 2025 *)
  • PARI
    a(n)={n||return(2);primepi(prime(n+1)^2)-primepi(prime(n)^2)} \\ M. F. Hasler, Dec 31 2014

Formula

For all n >= 1, a(n) = A256468(n) + A256469(n). - Antti Karttunen, Mar 30 2015
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 1. - Alain Rocchelli, Sep 30 2023

Extensions

Edited by N. J. A. Sloane, Nov 15 2009

A138511 Semiprimes where the larger prime factor is greater than the square of the smaller prime factor, short: semiprimes p*q, p^2 < q.

Original entry on oeis.org

10, 14, 22, 26, 33, 34, 38, 39, 46, 51, 57, 58, 62, 69, 74, 82, 86, 87, 93, 94, 106, 111, 118, 122, 123, 129, 134, 141, 142, 145, 146, 155, 158, 159, 166, 177, 178, 183, 185, 194, 201, 202, 205, 206, 213, 214, 215, 218, 219, 226, 235, 237, 249, 254, 262, 265, 267, 274, 278, 291, 295, 298, 302, 303, 305
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 21 2008

Keywords

Comments

From Antti Karttunen, Dec 17 2014, further edited Jan 01 & 04 2014: (Start)
Semiprimes p*q, p < q, such that the smallest r for which r^k <= p and q < r^(k+1) [for some k >= 0] is q+1, and thus k = 0. In other words, semiprimes whose both prime factors do not fit (simultaneously) between any two consecutive powers of any natural number r less than or equal to the larger prime factor. This condition forces the larger prime factor q to be greater than the square of the smaller prime factor because otherwise the opposite condition given in A251728 would hold.
Assuming that A054272(n), the number of primes in interval [prime(n), prime(n)^2], is nondecreasing (implied for example if Legendre's or Brocard's conjecture is true), these are also "unsettled" semiprimes that occur in a square array A083221 constructed from the sieve of Eratosthenes, "above the line A251719", meaning that if and only if row < A251719(col) then a semiprime occurring at A083221(row, col) is in this sequence, and conversely, all the semiprimes that occur at any position A083221(row, col) where row >= A251719(col) are in the complementary sequence A251728.
(End)
Semiprimes p*q, p < q, such that b = q+1 is the minimal base with the property that p and q have equal length representations in base b. This was the original definition, which is based primarily on A138510: A138510(A174956(a(n))) = A084127(A174956(a(n))) + 1.

Examples

			See A138510.
		

Crossrefs

Cf. A138510.
Complement of A251728 in A001358.
Subsequence of A088381.
An intersection of A001358 (semiprimes) and A251727.
Also an intersection of A001358 and A253569, from the latter which this sequence differs for the first time at n=60, where A253569(60) = 290, while here a(60) = 291.
Also an intersection A001358 and A245729.

Programs

Formula

Other identities. For all n >= 1 it holds that:
A138510(A174956(a(n))) = A084127(A174956(a(n))) + 1.

Extensions

Wrong comment corrected by Reinhard Zumkeller, Dec 16 2014
New definition by Antti Karttunen, Jan 01 2015; old definition moved to comment.
More terms from Antti Karttunen, Jan 09 2015

A251728 Semiprimes p*q for which p <= q < p^2.

Original entry on oeis.org

4, 6, 9, 15, 21, 25, 35, 49, 55, 65, 77, 85, 91, 95, 115, 119, 121, 133, 143, 161, 169, 187, 203, 209, 217, 221, 247, 253, 259, 287, 289, 299, 301, 319, 323, 329, 341, 361, 377, 391, 403, 407, 437, 451, 473, 481, 493, 517, 527, 529, 533, 551, 559, 583, 589, 611, 629, 649, 667, 671, 689, 697, 703
Offset: 1

Views

Author

Antti Karttunen, Dec 16 2014

Keywords

Comments

Semiprimes p*q for which there exists r <= q such that r^k <= p <= q < r^(k+1), for some k >= 1, i.e., semiprimes whose both prime factors fit inside a semiopen range of two consecutive powers of some natural number r which itself is not greater than the larger prime factor. If such r exists, then it must be <= p (the smaller prime factor of n), which forces q to be less than p^2. On the other hand, when p <= q < p^2, then setting r = p and k = 1 satisfies the equation r^k <= p <= q < r^(k+1).
Assuming that A054272(n), the number of primes in interval [p(n), p(n)^2], is nondecreasing (implied for example if Legendre's or Brocard's conjecture is true), it follows that for any a(n), A003961(a(n)) is also in sequence. In other words, whenever prime(i)*prime(j) is in the sequence, then so is also prime(i+1)*prime(j+1).
From above would follow also that these are all the "settled semiprimes" that occur in a square array A083221 constructed from the sieve of Eratosthenes, from the level A251719 downward. Furthermore, this sequence would then be an infinite disjoint union of sequences of A003961-iterates starting from the initial values given in A251724.
See also the comments in the complementary sequence of semiprimes, A138511.
Composite numbers n with all prime factors greater than the cube root of n. - Doug Bell, Oct 27 2015
If "p <= q" in the definition were changed to "p < q" then the squares of primes (A001248) would be removed, yielding A138109. - Jon E. Schoenfield, Dec 27 2022

Crossrefs

An intersection of A251726 and A001358 (semiprimes).
Complement of A138511 in A001358.
A251724 after the initial 2 is a subsequence.

Programs

  • Haskell
    a251728 n = a251728_list !! (n-1)
    a251728_list = filter f [1..] where
                          f x = q < p ^ 2 && a010051' q == 1
                                where q = div x p; p = a020639 x
    -- Reinhard Zumkeller, Jan 06 2015
    
  • Mathematica
    fQ[n_] := Block[{pf = FactorInteger@ n, p, q}, p = pf[[1, 1]]; q = pf[[-1, 1]]; And[p <= q < p^2, PrimeOmega@ n == 2]]; Select[Range@ 720, fQ] (* Michael De Vlieger, Oct 27 2015 *)
  • PARI
    lista(nn) = forcomposite(n=1, nn, my(f = factor(n));if (#select(x->(x > n^(1/3)), f[,1]) == #f~, print1(n, ", "))); \\ Michel Marcus, Oct 27 2015
    
  • PARI
    list(lim)=my(v=List()); forprime(q=2,sqrtnint((lim\1)^2,3), forprime(p=sqrtint(q)+1,min(q,lim\q), listput(v,p*q))); Set(v) \\ Charles R Greathouse IV, Oct 27 2015
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A251728(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 int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(min(x//p,p**2)) for p in primerange(s+1)))
        return bisection(f,n,n) # Chai Wah Wu, Mar 05 2025

Formula

For all n >= 1, A078898(a(n)) = A243055(a(n)) + 2.
Limit_{n->oo} n*log(a(n))/a(n) = log(2). - Alain Rocchelli, Nov 10 2022

A251723 First differences of A054272, A250473 and A250474: a(n) = A054272(n+1) - A054272(n).

Original entry on oeis.org

1, 4, 5, 14, 8, 21, 10, 26, 46, 15, 56, 43, 19, 45, 79, 77, 31, 89, 65, 29, 105, 74, 113, 162, 88, 41, 86, 41, 99, 353, 98, 164, 48, 298, 57, 181, 185, 127, 197, 194, 75, 355, 76, 143, 74, 462, 478, 167, 81, 165, 269, 89, 437, 274, 273, 291, 90, 291, 198, 98, 511, 734, 219, 106, 214, 783, 340, 578, 124, 240, 362, 488, 380, 379, 251, 393, 529, 261, 530, 669, 150, 708, 150
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Crossrefs

One less than A050216, the first differences of A000879.

Formula

a(n) = A054272(n+1) - A054272(n).
a(n) = A256447(n) + A256448(n). [Cf. also A256449.]

A251717 a(n) = smallest positive integer k such that A083221(k, n) has at most two prime factors (is a prime or semiprime).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 3, 2, 2, 1, 2, 3, 4, 2, 3, 1, 2, 1, 5, 3, 2, 3, 2, 1, 3, 6, 2, 1, 2, 1, 3, 2, 3, 1, 4, 2, 3, 2, 2, 1, 2, 2, 3, 2, 3, 1, 3, 1, 4, 4, 2, 3, 2, 1, 5, 2, 2, 1, 4, 1, 4, 2, 2, 3, 3, 1, 3, 3, 2, 1, 2, 4, 3, 2, 3, 1, 2, 2, 5, 3, 3, 3, 2, 1, 3, 2, 2, 1, 4, 1, 3, 3, 2, 1, 5, 1, 4, 3, 2, 1, 2, 2, 3, 2, 3, 4, 2
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Comments

Records occur at 1, 4, 8, 26, 32, 39, 238, 462, 1075, 1763, ... with record values 1, 2, 3, 4, 5, 6, 8, 9, 11, 13, ...
New distinct values occur at 1, 4, 8, 26, 32, 39, 238, 306, 462, 1075, 1106, 1763, ... with the values 1, 2, 3, 4, 5, 6, 8, 7, 9, 11, 10, 13, ...

Crossrefs

Variant: A251718.
The positions of ones: A008578.
a(n+1) differs from A057217(n-1) for the first time at n=19, where a(20) = 3, while A057217(18) = 4.

Programs

Formula

For all n, a(n) <= A251718(n) <= A251719(n).

A251718 a(n) = smallest positive integer k such that both A083221(k, n) and A083221(k+1, n) have at most two prime factors (are primes or semiprimes).

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 1, 3, 4, 2, 3, 4, 3, 5, 2, 2, 4, 3, 1, 3, 2, 4, 3, 2, 5, 4, 2, 3, 4, 2, 1, 5, 6, 2, 3, 2, 1, 3, 6, 4, 4, 4, 6, 3, 4, 5, 3, 6, 4, 6, 2, 4, 3, 4, 2, 5, 8, 5, 6, 3, 3, 4, 4, 2, 3, 2, 3, 7, 6, 5, 3, 4, 4, 6, 2, 2, 5, 7, 1, 5, 5, 4, 6, 2, 4, 6, 5, 5, 4, 2, 2, 5, 3, 3, 3, 4, 1, 3, 5, 7, 5, 4, 3, 3, 5, 2, 4, 5, 7, 4, 7, 4, 3, 7, 4, 3, 2, 3, 4, 2
Offset: 1

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Crossrefs

Variant: A251717.
A005382 gives the positions of 1 after the initial a(1)=1.

Programs

Formula

For all n, A251717(n) <= a(n) <= A251719(n).

A284263 a(n) = A252459(2*A000040(n)), a(0) = 0 by convention.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 24 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n<1, 0, Block[{k=1}, While[Prime[n + k  - 1] > Prime[k]^2, k++]; k - 1]]; Table[a[n], {n, 0, 130}] (*  Indranil Ghosh, Mar 24 2017 *)
  • PARI
    A284263(n) = { my(k=1); if(0==n, 0, while(prime(n+k-1) > (prime(k)^2), k = k+1);(k-1)); };
    
  • Python
    from sympy import prime
    def a(n):
        if n<1: return 0
        k=1
        while prime(n + k - 1)>prime(k)**2:k+=1
        return k - 1 # Indranil Ghosh, Mar 24 2017
  • Scheme
    (define (A284263 n) (if (zero? n) n (A252459 (* 2 (A000040 n)))))
    

Formula

a(0) = 0, for n >= 1, a(n) = A252459(2*A000040(n)).
a(n) = A252459(A002110(n)).
Showing 1-10 of 10 results.