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 14 results. Next

A001223 Prime gaps: differences between consecutive primes.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4, 2, 4, 12, 8, 4, 8, 4, 6, 12
Offset: 1

Views

Author

Keywords

Comments

There is a unique decomposition of the primes: provided the weight A117078(n) is > 0, we have prime(n) = weight * level + gap, or A000040(n) = A117078(n) * A117563(n) + a(n). - Rémi Eismann, Feb 14 2008
Let rho(m) = A179196(m), for any n, let m be an integer such that p_(rho(m)) <= p_n and p_(n+1) <= p_(rho(m+1)), then rho(m) <= n < n + 1 <= rho(m + 1), therefore a(n) = p_(n+1) - p_n <= p_rho(m+1) - p_rho(m) = A182873(m). For all rho(m) = A179196(m), a(rho(m)) < A165959(m). - John W. Nicholson, Dec 14 2011
A solution (modular square root) of x^2 == A001248(n) (mod A000040(n+1)). - L. Edson Jeffery, Oct 01 2014
There exists a constant C such that for n -> infinity, Cramer conjecture a(n) < C log^2 prime(n) is equivalent to (log prime(n+1)/log prime(n))^n < e^C. - Thomas Ordowski, Oct 11 2014
a(n) = A008347(n+1) - A008347(n-1). - Reinhard Zumkeller, Feb 09 2015
Yitang Zhang proved lim inf_{n -> infinity} a(n) is finite. - Robert Israel, Feb 12 2015
lim sup_{n -> infinity} a(n)/log^2 prime(n) = C <==> lim sup_{n -> infinity}(log prime(n+1)/log prime(n))^n = e^C. - Thomas Ordowski, Mar 09 2015
a(A038664(n)) = 2*n and a(m) != 2*n for m < A038664(n). - Reinhard Zumkeller, Aug 23 2015
If j and k are positive integers then there are no two consecutive primes gaps of the form 2+6j and 2+6k (A016933) or 4+6j and 4+6k (A016957). - Andres Cicuttin, Jul 14 2016
Conjecture: For any positive numbers x and y, there is an index k such that x/y = a(k)/a(k+1). - Andres Cicuttin, Sep 23 2018
Conjecture: For any three positive numbers x, y and j, there is an index k such that x/y = a(k)/a(k+j). - Andres Cicuttin, Sep 29 2018
Conjecture: For any three positive numbers x, y and j, there are infinitely many indices k such that x/y = a(k)/a(k+j). - Andres Cicuttin, Sep 29 2018
Row m of A174349 lists all indices n for which a(n) = 2m. - M. F. Hasler, Oct 26 2018
Since (6a, 6b) is an admissible pattern of gaps for any integers a, b > 0 (and also if other multiples of 6 are inserted in between), the above conjecture follows from the prime k-tuple conjecture which states that any admissible pattern occurs infinitely often (see, e.g., the Caldwell link). This also means that any subsequence a(n .. n+m) with n > 2 (as to exclude the untypical primes 2 and 3) should occur infinitely many times at other starting points n'. - M. F. Hasler, Oct 26 2018
Conjecture: Defining b(n,j,k) as the number of pairs of prime gaps {a(i),a(i+j)} such that i < n, j > 0, and a(i)/a(i+j) = k with k > 0, then
lim_{n -> oo} b(n,j,k)/b(n,j,1/k) = 1, for any j > 0 and k > 0, and
lim_{n -> oo} b(n,j,k1)/b(n,j,k2) = C with C = C(j,k1,k2) > 0. - Andres Cicuttin, Sep 01 2019

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 92.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 186-192.
  • 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. A000040 (primes), A001248 (primes squared), A000720, A037201, A007921, A030173, A036263-A036274, A167770, A008347.
Second difference is A036263, first occurrence is A000230.
For records see A005250, A005669.
Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556-A330561.

Programs

  • Haskell
    a001223 n = a001223_list !! (n-1)
    a001223_list = zipWith (-) (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Magma
    [(NthPrime(n+1) - NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    with(numtheory): for n from 1 to 500 do printf(`%d,`,ithprime(n+1) - ithprime(n)) od:
  • Mathematica
    Differences[Prime[Range[100]]] (* Harvey P. Dale, May 15 2011 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i]);
    diff(primes(100)) \\ Charles R Greathouse IV, Feb 11 2011
    
  • PARI
    forprime(p=1, 1e3, print1(nextprime(p+1)-p, ", ")) \\ Felix Fröhlich, Sep 06 2014
    
  • Python
    from sympy import prime
    def A001223(n): return prime(n+1)-prime(n) # Chai Wah Wu, Jul 07 2022
  • Sage
    differences(prime_range(1000)) # Joerg Arndt, May 15 2011
    

Formula

G.f.: b(x)*(1-x), where b(x) is the g.f. for the primes. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = prime(n+1) - prime(n). - Franklin T. Adams-Watters, Mar 31 2010
Conjectures: (i) a(n) = ceiling(prime(n)*log(prime(n+1)/prime(n))). (ii) a(n) = floor(prime(n+1)*log(prime(n+1)/prime(n))). (iii) a(n) = floor((prime(n)+prime(n+1))*log(prime(n+1)/prime(n))/2). - Thomas Ordowski, Mar 21 2013
A167770(n) == a(n)^2 (mod A000040(n+1)). - L. Edson Jeffery, Oct 01 2014
a(n) = Sum_{k=1..2^(n+1)-1} (floor(cos^2(Pi*(n+1)^(1/(n+1))/(1+primepi(k))^(1/(n+1))))). - Anthony Browne, May 11 2016
G.f.: (Sum_{k>=1} x^pi(k)) - 1, where pi(k) is the prime counting function. - Benedict W. J. Irwin, Jun 13 2016
Conjecture: Limit_{N->oo} (Sum_{n=2..N} log(a(n))) / (Sum_{n=2..N} log(log(prime(n)))) = 1. - Alain Rocchelli, Dec 16 2022
Conjecture: The asymptotic limit of the average of log(a(n)) ~ log(log(prime(n))) - gamma (where gamma is Euler's constant). Also, for n tending to infinity, the geometric mean of a(n) is equivalent to log(prime(n)) / e^gamma. - Alain Rocchelli, Jan 23 2023
It has been conjectured that primes are distributed around their average spacing in a Poisson distribution (cf. D. A. Goldston in above links). This is the basis of the last two conjectures above. - Alain Rocchelli, Feb 10 2023

Extensions

More terms from James Sellers, Feb 19 2001

A037201 Differences between consecutive primes (A001223) but with repeats omitted.

Original entry on oeis.org

1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 4, 6, 2, 10, 2, 4, 2, 12, 4, 2, 4, 6, 2, 10, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4
Offset: 1

Views

Author

Keywords

Comments

Also the run-compression of the sequence of first differences of prime numbers, where we define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1). - Gus Wiseman, Sep 16 2024

Crossrefs

This is the run-compression of A001223 = first differences of A000040.
The repeats were at positions A064113 before being omitted.
Adding up runs instead of compressing them gives A373822.
The even terms halved are A373947.
For prime-powers instead of prime numbers we have A376308.
Positions of first appearances are A376520, sorted A376521.
A003242 counts compressed compositions.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.

Programs

  • Haskell
    a037201 n = a037201_list !! (n-1)
    a037201_list = f a001223_list where
       f (x:xs@(x':_)) | x == x'   = f xs
                       | otherwise = x : f xs
    -- Reinhard Zumkeller, Feb 27 2012
    
  • Mathematica
    Flatten[Split[Differences[Prime[Range[150]]]]/.{(k_)..}:>k] (* based on a program by Harvey P. Dale, Jun 21 2012 *)
  • PARI
    t=0;p=2;forprime(q=3,1e3,if(q-p!=t,print1(q-p", "));t=q-p;p=q) \\ Charles R Greathouse IV, Feb 27 2012

Formula

a(n>1) = 2*A373947(n-1). - Gus Wiseman, Sep 16 2024

Extensions

Offset corrected by Reinhard Zumkeller, Feb 27 2012

A007921 Numbers that are not the difference of two primes.

Original entry on oeis.org

7, 13, 19, 23, 25, 31, 33, 37, 43, 47, 49, 53, 55, 61, 63, 67, 73, 75, 79, 83, 85, 89, 91, 93, 97, 103, 109, 113, 115, 117, 119, 121, 123, 127, 131, 133, 139, 141, 143, 145, 151, 153, 157, 159, 163, 167, 169, 173, 175, 181, 183, 185, 187, 193
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Conjecturally, odd numbers k such that k+2 is composite.
Is this the same as A068780(2n-1) - 1? - J. Stauduhar, Aug 23 2012
A092953(a(n)) = 0. - Reinhard Zumkeller, Nov 10 2012
It seems that the sequence contains the squares of all primes except for 2 and 3. - Ivan N. Ianakiev, Aug 29 2013 [It does: For every prime p > 3, note that p^2 == 1 (mod 3), so p^2 cannot be q - r where q and r are primes. (If it were, then since p^2 is odd, q and r could not both be odd primes; r would have to be the even prime, 2, which would mean that p^2 = q - 2, so q = p^2 + 2 == 0 (mod 3), i.e., 3 would divide q, so q would not be prime -- a contradiction.) - Jon E. Schoenfield, May 03 2024]
Integers d such that A123556(d) = 1, that is, integers d such that the largest possible arithmetic progression (AP) of primes with common difference d has only one element. For each such d, the unique element of all the first largest APs with 1 element is A342309(d) = 2. - Bernard Schott, Jan 08 2023
If it exists, the least even term is > 10^12 (see 1st comment in A020483). - Bernard Schott, Jan 09 2023

References

  • F. Smarandache, Properties of Numbers, 1972. (See Smarandache odd sieve.)

Crossrefs

Cf. A048859.
Complement of A030173. Cf. A001223.
Cf. also A005408, A010051.
Largest AP of prime numbers with k elements: this sequence (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), A206042 (k=8), A206043 (k=9), A206044 (k=10), A206045 (k=11).

Programs

  • Haskell
    a007921 n = a007921_list !! (n-1)
    a007921_list = filter ((== 0) . a010051' . (+ 2)) [1, 3 ..]
    -- Reinhard Zumkeller, Jul 03 2015
    
  • Maple
    filter :=  d -> irem(d, 2) <> 0 and not isprime(2+d) : select(filter, [`$`(1 .. 200)]); # Bernard Schott, Jan 08 2023
  • Mathematica
    Lim=200;nn=10;seq:=Complement[Range[Lim],Union[Flatten[Differences/@Subsets[Prime[Range[nn]],{2}]]]];Until[AllTrue[seq,OddQ],nn++];seq (* James C. McMahon, May 04 2024 *)
  • PARI
    is(n)=n%2 && !isprime(n+2) \\ On Polignac's conjecture; Charles R Greathouse IV, Jun 28 2013
    
  • Python
    from sympy import isprime
    print([n for n in range(1, 200) if n%2 and not isprime(n + 2)]) # Indranil Ghosh, Jun 15 2017, after Charles R Greathouse IV

A046665 Largest prime divisor of n - smallest prime divisor of n (a(1)=0).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 5, 2, 0, 0, 1, 0, 3, 4, 9, 0, 1, 0, 11, 0, 5, 0, 3, 0, 0, 8, 15, 2, 1, 0, 17, 10, 3, 0, 5, 0, 9, 2, 21, 0, 1, 0, 3, 14, 11, 0, 1, 6, 5, 16, 27, 0, 3, 0, 29, 4, 0, 8, 9, 0, 15, 20, 5, 0, 1, 0, 35, 2, 17, 4, 11, 0, 3, 0, 39, 0, 5, 12, 41, 26, 9, 0
Offset: 1

Views

Author

Keywords

Comments

Even nonzero terms correspond to odd composite numbers that are not powers of primes. Terms of A030173 appear in this sequence infinitely often. - Alonso del Arte, Nov 27 2011
A135093(n) = first occurrence of A030173(n). - Reinhard Zumkeller, Jul 03 2015

References

  • Handbook of Number Theory, D. S. Mitrinovic et al., Kluwer, Section IV.1.

Crossrefs

Programs

  • Haskell
    a046665 n = a006530 n - a020639 n  -- Reinhard Zumkeller, Jul 03 2015
    
  • Maple
    a:= n-> `if`(n=1, 0, (s-> max(s)-min(s))(numtheory[factorset](n))):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 07 2020
  • Mathematica
    f[n_]:=Transpose[FactorInteger[n]][[1]];Table[Last[f[n]-First[f[n]]],{n,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
    lpd[n_]:=Module[{fi=FactorInteger[n]},fi[[-1,1]]-fi[[1,1]]]; Array[lpd,90] (* Harvey P. Dale, Dec 31 2017 *)
  • PARI
    a(n)={if(n==1, 0, my(f=factor(n)[,1]); f[#f]-f[1])} \\ Andrew Howroyd, Mar 07 2020

Formula

a(n) = A006530(n) - A020639(n).

Extensions

More terms from James Sellers

A376560 Points of upward concavity in the sequence of perfect-powers (A001597). Positives of A376559.

Original entry on oeis.org

1, 3, 4, 6, 8, 9, 10, 11, 12, 15, 16, 17, 20, 22, 23, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 41, 42, 43, 44, 46, 47, 48, 49, 50, 53, 54, 55, 57, 58, 60, 61, 62, 63, 64, 65, 67, 68, 69, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91
Offset: 1

Views

Author

Gus Wiseman, Sep 30 2024

Keywords

Comments

These are points at which the second differences are positive.
Perfect-powers (A001597) are numbers with a proper integer root.
Note that, for some sources, upward concavity is negative curvature.

Examples

			The perfect powers (A001597) are:
  1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, ...
with first differences (A053289):
  3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, 33, ...
with first differences (A376559):
  1, -3, 6, 2, -7, 3, -1, 9, 2, 2, 2, 2, -17, -1, 13, 9, 2, -7, -11, 9, -5, 20, 2, ...
with positive positions (A376560):
  1, 3, 4, 6, 8, 9, 10, 11, 12, 15, 16, 17, 20, 22, 23, 26, 27, 28, 31, 32, 33, 34, ...
		

Crossrefs

The version for A000002 is A022297, complement A025505. See also A054354, A376604.
For first differences we have A053289, union A023055, firsts A376268, A376519.
For primes instead of perfect-powers we have A258025.
These are positions of positive terms in A376559.
For downward concavity we have A376561 (probably the complement).
A001597 lists the perfect-powers.
A064113 lists positions of adjacent equal prime gaps.
A333254 gives run-lengths of differences between consecutive primes.
Second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power).

Programs

  • Maple
    N:= 10^6: # to use perfect powers <= N
    S:= {1,seq(seq(i^j,j=2..floor(log[i](N))),i=2..isqrt(N))}:
    L:= sort(convert(S,list)):
    DL:= L[2..-1]-L[1..-2]:
    D2L:= DL[2..-1]-DL[1..-2]:
    select(i -> D2L[i]>0, [$1..nops(D2L)]); # Robert Israel, Dec 01 2024
  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Join@@Position[Sign[Differences[Select[Range[1000],perpowQ],2]],1]

A015886 a(n) = smallest number k such that sigma(k + n) = sigma(k) + n, or -1 if no such number exists.

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 5, 74, 3, 2, 3, 2, 5, 4418, 3, 2, 3, 2, 5, 6, 3, 2, 7
Offset: 0

Views

Author

Keywords

Comments

There are solutions to sigma(k)+n=sigma(k+n) whenever n is the difference between two primes (A030173), e.g. k and k+n are primes. There are other values of n that have solutions (see example).
a(23) > 4292000000, if it exists. - Jud McCranie, Jan 05 2000
The sequence begins: 1, 2, 3, 2, 3, 2, 5, 74, 3, 2, 3, 2, 5, 4418, 3, 2, 3, 2, 5, 6, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, 18, 3, 2, 5, 44, 3, 2, 3, 2, 5, ?, 3, 2, 7, ?, 5, 3315, 3, 2, 7, ?, 5, ?, 3, 2, 3, 2, 7, ?, 5, ?, 3, 2, 5, ?, 3, 2, 3, 2, 7, 18, 5, ?, 3, 2, 5, ?, 3, 2, 7, ?, 5, ?, 3, 2, 13, ?, 7, ?, 5, 32, 3, 2, 5 where the other missing terms (designated by "?") are > 10^9, if they exist. - Jud McCranie, Jan 08 2000
The "other" values of n are the odd n such that n+2 is not prime. For these n, in order for sigma(k) or sigma(n+k) to be odd, either k or n+k must be a square or twice a square. Examples: for n=7, n+k=9^2; for n=13, k=2*47^2 and for n=19, n+k=5^2. Using this idea, it is easy to show that if a(23) exists it is greater than 10^12. - T. D. Noe, Sep 24 2007

Examples

			sigma(74+7) = 121 = sigma(74)+7, so a(7) = 74.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1; While[DivisorSigma[1,k+n] != DivisorSigma[1,k]+n, k++ ]; k, {n,0,22}] (* T. D. Noe, Sep 24 2007 *)
  • PARI
    a(n) = {my(k=1); while(sigma(k+n) != sigma(k) + n, k++); k;} \\ Michel Marcus, May 23 2018

Formula

a(2n) = A020483(n) = A054906(n) - T. D. Noe, Sep 24 2007

A092953 Number of primes of the form n+p, where p is a prime < n.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Mar 24 2004

Keywords

Comments

Might be called the additive primability of n.
a(A007921(n))=0; for n > 2: a(A030173(n)) > 0 and a(A040976(n)) = 1. - Reinhard Zumkeller, Nov 10 2012

Examples

			a(26) = 4: the primes are 29, 31, 37 and 43.
		

Crossrefs

Cf. A092954.
Cf. A061357.

Programs

  • Haskell
    a092953 n = sum $
       zipWith (\u v -> a010051' u * a010051' v) [1 .. n - 1] [n + 1 ..]
    -- Reinhard Zumkeller, Nov 10 2012
  • PARI
    for(n=1,105,c=0;forprime(p=2,n-1,if(isprime(n+p),c++));print1(c,","))
    

Extensions

More terms from Klaus Brockhaus and Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 25 2004

A376343 Positions of twos in the run-compressed (A037201) first differences (A001223) of the primes (A000040).

Original entry on oeis.org

2, 4, 6, 9, 12, 15, 18, 24, 26, 31, 33, 37, 39, 41, 44, 47, 50, 53, 57, 62, 73, 75, 81, 90, 95, 99, 102, 105, 108, 127, 129, 131, 135, 139, 156, 158, 161, 163, 167, 173, 182, 187, 190, 193, 196, 205, 210, 214, 216, 232, 235, 241, 244, 247, 254, 263, 265, 270
Offset: 1

Views

Author

Gus Wiseman, Sep 26 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime numbers (A000040) is:
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, ...
with first differences (A001223):
  1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, ...
with run-compression (A037201):
  1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, ...
with twos at (A376343):
  2, 4, 6, 9, 12, 15, 18, 24, 26, 31, 33, 37, 39, 41, 44, 47, 50, 53, 57, 62, 73, ...
		

Crossrefs

Positions of 2's in A037201.
The repeats were at positions A064113 before being omitted.
A variation for squarefree numbers is A376342.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A005117 lists squarefree numbers, differences A076259 (ones A375927).
A013929 lists nonsquarefree numbers, differences A078147.
A333254 lists run-lengths of differences between consecutive primes.

Programs

  • Mathematica
    Join@@Position[First/@Split[Differences[Select[Range[100],PrimeQ]]],2]

Formula

For just the odd primes we have a(n) - 1.

A376521 Sorted positions of first appearances in the run-compression (A037201) of the first differences (A001223) of the prime numbers (A000040).

Original entry on oeis.org

1, 2, 3, 8, 22, 28, 32, 42, 91, 141, 172, 198, 242, 259, 341, 400, 556, 692, 1119, 1737, 1779, 2072, 2101, 2913, 3126, 3204, 3246, 3457, 3598, 4294, 4383, 7596, 7651, 8284, 11986, 13729, 14220, 15101, 16273, 18217, 22303, 29523, 30243, 32236, 32808, 32820
Offset: 1

Views

Author

Gus Wiseman, Sep 26 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime numbers (A000040) is:
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, ...
with first differences (A001223):
  1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, ...
with run-compression (A037201):
  1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, ...
with first appearances at (A376521):
  1, 2, 3, 8, 22, 28, 32, 42, 91, 141, 172, 198, 242, 259, 341, 400, 556, 692, 1119, ...
		

Crossrefs

These are the sorted positions of first appearances in A037201.
For positions of twos instead of first appearances we have A376343.
The unsorted version is A376520.
A000040 lists the prime numbers, differences A001223.
A003242 counts compressed compositions, ranks A333489.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.

Programs

  • Mathematica
    q=First/@Split[Differences[Select[Range[1000],PrimeQ]]];
    Select[Range[Length[q]],!MemberQ[Take[q,#-1],q[[#]]]&]

A135093 Least composite number k for each possible difference gpf(k)-lpf(k).

Original entry on oeis.org

4, 6, 15, 10, 21, 14, 55, 33, 22, 39, 26, 85, 51, 34, 57, 38, 115, 69, 46, 203, 145, 87, 58, 93, 62, 259, 185, 111, 74, 205, 123, 82, 129, 86, 235, 141, 94, 371, 265, 159, 106, 413, 295, 177, 118, 183, 122, 469, 335, 201, 134, 355, 213, 142, 219, 146, 553, 395, 237
Offset: 0

Views

Author

Rick L. Shepherd, Nov 18 2007

Keywords

Comments

Clearly all terms are semiprimes. a(0)=prime(1)^2=4. For n>=1, a(n)=k, a squarefree semiprime, where gpf(k)-lpf(k)=A006530(k)-A020639(k)=A030173(k).
For n > 0: first occurrences of A030173(n) in A046665. - Reinhard Zumkeller, Jul 03 2015

Examples

			a(3)=2*5=10 because 5-2=3=A030173(3), where the latter terms are ordered by the increasing possible differences between two distinct primes and no smaller composite number has a difference of 3 between its least and greatest prime factors.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a135093 0 = 4
    a135093 n = (+ 1) $ fromJust $ (`elemIndex` a046665_list) $ a030173 n
    -- Reinhard Zumkeller, Jul 03 2015
Showing 1-10 of 14 results. Next