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

A217691 Primes in A217689.

Original entry on oeis.org

2, 3, 19, 23, 31, 43, 59, 61, 73, 83, 103, 107, 109, 113, 151, 163, 179, 181, 197, 199, 233, 241, 269, 271, 277, 281, 283, 313, 317, 349, 353, 379, 383, 409, 421, 433, 443, 449, 461, 463, 503, 509, 523, 571, 577, 593, 599, 601, 617, 619, 643, 647, 659, 661, 677
Offset: 1

Views

Author

Vladimir Shevelev, Oct 11 2012

Keywords

Comments

Apart from the initial 2, the odd terms of A217689. - M. F. Hasler, Oct 19 2012

Crossrefs

Cf. A217689.

Formula

If A(n) is the number of terms not exceeding n, then heuristically A(n) is equivalent to log(2)*pi(n), as n tends to infinity. Practically, an approximation of A(n)is given by the expression n*log(2)/log(n*log(n)).

A217833 The largest number not exceeding n^2, such that there are no terms of the sequence in the interval (a(n-1)/2, a(n)/2), with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 32, 49, 64, 81, 98, 121, 128, 162, 196, 225, 242, 256, 324, 361, 392, 441, 450, 484, 512, 625, 648, 722, 784, 841, 882, 900, 968, 1024, 1156, 1225, 1250, 1296, 1444, 1521, 1568, 1681, 1682, 1764, 1800, 1936, 2048, 2209, 2304, 2312, 2450
Offset: 0

Views

Author

Vladimir Shevelev, Oct 12 2012

Keywords

Comments

Every term has the form s*2^k, where s>=0 is a square and k>=0.

Examples

			Let us find a(6), knowing the previous terms. Since a(5) = 16 and a(4)<=16/2<a(5). Then a(6) = 2*a(5) = 32, since 32<6^2 = 36. Further, since a(5)<=a(6)/2<a(6), then a(7) = 7^2 = 49, since 49<2*a(6) = 64.
		

Crossrefs

Cf. A217689.

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, t;
          if n<2 then n
        else i, j, k, t:= 0, n-1, iquo(n-1, 2), a(n-1)/2;
             while k<>i do if a(k)<=t then i:=k else j:=k fi;
                           k:= iquo(i+j,2) od;
             min(n^2, 2*a(k+1))
          fi
        end:
    seq (a(n), n=0..100);  # Alois P. Heinz, Nov 03 2012
  • Mathematica
    a[n_] := a[n] = Module[{i, j, k, t}, If[n < 2, n,
         {i, j, k, t} = {0, n-1, Quotient[n-1, 2], a[n-1]/2};
         While[k != i, If[a[k] <= t, i = k, j = k]; k = Quotient[i+j, 2]];
         Min[n^2, 2*a[k+1]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 20 2022, after Alois P. Heinz *)

Formula

a(n) = min(2*a(k+1), n^2) for n>=2 and a(k) <= a(n-1)/2 < a(k+1).

Extensions

More terms from Alois P. Heinz, Nov 02 2012

A217884 Let c(m)=prime(m), m=1,2,3,4. For m>=5, suppose that c(m)/e is in the interval [c(k),c(k+1)). Then let c(m+1)=e*c(k+1) if e*c(k+1) < prime(m+1), and otherwise let c(m+1) = prime(m+1). Then a(n) is the n-th prime in {c(m)}.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 31, 43, 47, 67, 71, 73, 79, 83, 103, 107, 109, 113, 137, 139, 157, 163, 173, 179, 181, 197, 211, 229, 239, 241, 251, 257, 269, 271, 283, 313, 317, 337, 347, 353, 359, 367, 397, 401, 409, 419
Offset: 1

Views

Author

Vladimir Shevelev, Oct 14 2012

Keywords

Comments

The preliminary sequence begins 2,3,5,7,3*e,13,5*e,19,7*e,3*e^2,31,...
with terms of the form p*e^k, where p is prime, k>=0.

Crossrefs

Formula

If A(n)is the number of terms not exceeding n, then heuristically A(n)~pi(n). Practically, an approximation is given by formula A(n) ~ n/log(n*log(n)).

Extensions

Terms a(1)-a(20) confirmed and terms a(21)-a(46) added by John W. Layman, Oct 24 2012

A218121 Numerator of c(n) defined by c(1)=1, c(2)=5/2 and for n>=3, c(n) is the minimal rational number >= c(n-1) such that there are no primes in the interval (prime(n)/c(n), prime(n+1)/c(n)).

Original entry on oeis.org

1, 5, 5, 11, 11, 17, 17, 17, 29, 29, 29, 41, 41, 41, 41, 41, 41, 67, 67, 67, 67, 83, 83, 83, 83, 83, 83, 109, 109, 127, 127, 127, 127, 149, 149, 149, 149, 149, 149, 149, 181, 181, 181, 181, 181, 181, 181, 181, 229, 229, 229, 229, 251, 251, 251, 251, 251, 251, 251, 251
Offset: 1

Views

Author

Vladimir Shevelev, Oct 21 2012

Keywords

Comments

The sequence c(n) begins 1, 5/2, 5/2, 11/2, 11/2, 17/3, ...
Its terms > 1 are ratios of primes.

Examples

			Intervals (2/1,3/1),(3/(5/2),5/(5/2)) are free from primes. By the condition, c(3) >= c(2) = 5/2. Since also (5/(5/2),7/(5/2)) contains no prime, then c(3)=5/2. Further, c(4) should be chosen minimal>=5/2 such that the interval (7/c(4),11/c(4)) does not contain 2 and 3 (it is clear that it contains no prime>=5). It is easy to see that the minimal c(4)=11/2, etc.
		

Crossrefs

Cf. A218123 (denominator), A217871, A217689, A217691, A217833, A217884.

Programs

  • Maple
    ispfree := proc(a,b)
        local alow ;
        alow := floor(a);
        if nextprime(alow) < b then
            false;
        else
            true;
        end if;
    end proc:
    A218121c := proc(n)
        option remember;
        local k ;
        if n = 1 then
            return 1;
        elif n = 2 then
            return 5/2 ;
        else
            if ispfree(ithprime(n)/procname(n-1),ithprime(n+1)/procname(n-1)) then
                return procname(n-1) ;
            end if ;
            for k from n by -1 do
                if ispfree( ithprime(n)*ithprime(k)/ithprime(n+1),ithprime(k) )
                    and ithprime(n+1)/ithprime(k) > procname(n-1) then
                    return ithprime(n+1)/ithprime(k) ;
                end if;
            end do:
        end if;
    end proc:
    A218121 := proc(n)
        numer(A218121c(n)) ;
    end proc: # R. J. Mathar, Dec 02 2012
  • Mathematica
    ispfree[a_, b_] := NextPrime[Floor[a]] >= b;
    c[n_] := c[n] = Module[{k}, Which[n == 1, Return[1], n == 2, Return[5/2], True, If[ispfree[Prime[n]/c[n-1], Prime[n+1]/c[n-1]], Return[c[n-1]]]; For[k = n, True, k--, If[ispfree[Prime[n]*Prime[k]/Prime[n+1], Prime[k]] && Prime[n+1]/Prime[k] > c[n-1], Return[Prime[n+1]/Prime[k]]]]]];
    a[n_] := Numerator[c[n]];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Dec 01 2023, after R. J. Mathar *)

Formula

For n>=3, if interval (prime(n)/c(n-1), prime(n+1)/c(n-1)) is free from primes, then c(n)=c(n-1); otherwise, c(n)=prime(n+1)/prime(k), where k<=n is the maximal, such that a) prime(n+1)/prime(k)>c(n-1) and b) the open interval (prime(n)*prime(k)/prime(n+1), prime(k)) does not contain any prime.
Note that such k exists, since, for k=1, the interval (2*prime(n)/prime(n+1),2) is free from primes.

A218123 Denominators of terms of the sequence {c(n)} defined in A218121.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 3, 3, 5, 5, 5, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 43, 43, 43, 43, 43, 47, 47
Offset: 1

Views

Author

Vladimir Shevelev, Oct 21 2012

Keywords

Comments

It is easy to see that every prime is in the sequence.

Crossrefs

Programs

  • Maple
    ispfree := proc(a,b)
        local alow ;
        alow := floor(a);
        if nextprime(alow) < b then
            false;
        else
            true;
        end if;
    end proc:
    A218121c := proc(n)
        option remember;
        local k ;
        if n = 1 then
            return 1;
        elif n = 2 then
            return 5/2 ;
        else
            if ispfree(ithprime(n)/procname(n-1),ithprime(n+1)/procname(n-1)) then
                return procname(n-1) ;
            end if ;
            for k from n by -1 do
                if ispfree( ithprime(n)*ithprime(k)/ithprime(n+1),ithprime(k) )
                    and ithprime(n+1)/ithprime(k) > procname(n-1) then
                    return ithprime(n+1)/ithprime(k) ;
                end if;
            end do:
        end if;
    end proc:
    A218123 := proc(n)
        denom(A218121c(n)) ;
    end proc: # R. J. Mathar, Dec 02 2012
Showing 1-5 of 5 results.