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

A030296 Smallest start for a run of at least n composite numbers.

Original entry on oeis.org

4, 8, 8, 24, 24, 90, 90, 114, 114, 114, 114, 114, 114, 524, 524, 524, 524, 888, 888, 1130, 1130, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 9552, 9552, 15684, 15684, 15684, 15684, 15684, 15684, 15684, 15684, 19610, 19610, 19610
Offset: 1

Views

Author

Keywords

Comments

a(n) is even, since a(n)-1 is a prime > 2, by the minimality of a(n). - Jonathan Sondow, May 31 2014
Except for a(1), records occur at even values of n, and each term appears an even number of times consecutively. (Proof. A maximal run of composites must begin and end at even numbers.) - Jonathan Sondow, May 31 2014

Examples

			a(5) = 24 as 24 is the first of the five consecutive composite numbers 24, 25, 26, 27, 28.
		

References

  • Amarnath Murthy, Some more conjectures on primes and divisors, Smarandache Notions Journal, Vol. 12, No. 1-2-3, Spring 2001.

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = For[p1 = a[n-1]-1; p2 = NextPrime[p1], True, p1 = p2; p2 = NextPrime[p1], If[ p2-p1-1 >= n, Return[p1+1]]]; a[1] = 4; Table[a[n], {n, 1, 43}] (* Jean-François Alcover, May 24 2012 *)
    Module[{nn=20000,cmps},cmps=Table[If[CompositeQ[n],1,0],{n,nn}];Table[ SequencePosition[ cmps,PadRight[{},k,1],1][[1,1]],{k,50}]] (* Harvey P. Dale, Jan 01 2022 *)

Formula

a(n) = A104138(n) + 1. - Jonathan Sondow, May 31 2014

A135543 Record number of steps under iterations of "map n to n - (largest prime <= n)" (A064722) until reaching the limiting value 0 or 1. Also, places where A121561 reaches a new record.

Original entry on oeis.org

1, 2, 9, 122, 1357323
Offset: 0

Views

Author

Sergio Pimentel, Feb 22 2008

Keywords

Comments

a(5) must be very large (> 100000000). Can anyone extend the sequence?
Conjecture: there exist positive values of n for which a(n) != A175079(n) - 1. - Jaroslav Krizek, Feb 05 2010
From Thomas R. Nicely's data (see link) it seems that the smallest known prime with following prime gap of length a(4)+1 or more is 90823#/510510 - 1065962 (39279 digits), so a(5) = A104138(a(4)) + a(4) <= 90823#/510510 - 1065962 + 1357323 = A002110(8787)/510510 + 291361. (The bounding primes of this prime gap are only known to be probable primes, but if either of them were not prime, the gap would only be larger and the bound on a(5) would still hold.) - Pontus von Brömssen, Jul 31 2022

Examples

			a(4) = 1357323 because after iterating n - (largest prime <= n) we get:
  1357323 - 1357201 = 122 =>
  122 - 113 = 9 =>
  9 - 7 = 2 =>
  2 - 2 = 0,
which takes 4 steps.
		

Crossrefs

Programs

  • Mathematica
    LrgstPrm[n_] := Block[{k = n}, While[ !PrimeQ@ k, k-- ]; k]; f[n_] := Block[{c = 0, d = n}, While[d > 1, d = d - LrgstPrm@d; c++ ]; c]; lst = {}; record = -1; Do[ a = f@n; If[a > record, record = a; AppendTo[lst, a]; Print@ n], {n, 100}] (* Robert G. Wilson v *)
  • Python
    from sympy import prevprime
    from functools import lru_cache
    from itertools import count, islice
    @lru_cache(maxsize=None)
    def f(n): return 0 if n == 0 or n == 1 else 1 + f(n - prevprime(n+1))
    def agen(record=-1):
        for k in count(1):
            if f(k) > record: record = f(k); yield k
    print(list(islice(agen(), 4))) # Michael S. Branicky, Jul 26 2022

Formula

Iterate n - (largest prime <= n) until reaching 0 or 1. Count the iterations required to reach 0 or 1 and determine if it is a new record.
From Pontus von Brömssen, Jul 31 2022: (Start)
a(n) = A104138(a(n-1)) + a(n-1) for n >= 2.
A121561(a(n)) = n.
a(n) = A175079(n) - 1 for n >= 1, i.e., the conjecture in the Comments is false. This follows from the result that A175078(n) = A121561(n-1) for n >= 2.
(End)

A291545 a(n) is the smallest integer k > n such that (k+1)(k+2)...(2k-n)/(k(k-1)...(k-n+1)) is an integer.

Original entry on oeis.org

6, 6, 9, 10, 16, 16, 27, 27, 28, 28, 95, 95, 96, 96, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 537, 537, 538, 538, 539, 539, 540, 540, 905, 905, 906, 906, 1149, 1149, 1150, 1150, 1349, 1349, 1350, 1350, 1351, 1351, 1352, 1352
Offset: 1

Views

Author

Bernard Schott, Aug 26 2017

Keywords

Comments

This sequence comes from an exercise proposed by Paul Erdős for Crux Mathematicorum (see link). In the solution, it's proved that for n >= 4, the fraction is always an integer for k = (n+1)! - 2. Be careful, n and k are swapped between Crux Mathematicorum and this sequence. A stronger statement is proposed in A290791.
Erdős also proves that lim a(n)/n is infinite. That is, for any constant C, a(n) > C*n for all large enough n. - Charles R Greathouse IV, Aug 26 2017
From Jon E. Schoenfield, Aug 29 2017: (Start)
Observations up through a(294)=2010880 (and a lower bound on a(295)):
- for even n (except at n=4), a(n) = a(n-1);
- for odd n > 1, a(n) = a(n-1) + 1 except at n = 3, 5, 7, 11, 15, 27, 35, 39, 43, 67, 71, 87, 103, 143, 171, 191, 223, 227, 235, 263, 295, ...
A lower bound is given by a(n) >= A104138(j) + j where j = floor((n+1)/2) and A104138(j) is the smallest prime that is followed by j or more nonprimes. Conjecture: this bound is tight for all n > 6. (End)

Examples

			If n = 1, for k = 2, 3, 4, 5, the fraction is respectively equal to 3/2, (4*5)/3, (5*6*7)/4, (6*7*8*9)/5 but for k = 6, the quotient is (7*8*9*10*11)/6 = 9240 and so a(1) = 6.
		

Crossrefs

Programs

  • PARI
    a(n)=my(k=n+1,t=(n+2)/k!); while(denominator(t)>1, k++; t*=(2*k-n)*(2*k-n-1)*(k-n)/k^2); k \\ Charles R Greathouse IV, Aug 26 2017

Formula

a(n) = min_{k > n} : (k!/(k-n)!) | ((2k-n)!/k!). - Jon E. Schoenfield, Aug 28 2017

Extensions

Corrected and extended by Charles R Greathouse IV, Aug 26 2017
Showing 1-3 of 3 results.