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.

Previous Showing 11-14 of 14 results.

A376520 Position of first appearance of 2n in the run-compression (A037201) of the first differences (A001223) of the prime numbers (A000040).

Original entry on oeis.org

2, 3, 8, 22, 32, 42, 28, 259, 91, 141, 172, 242, 341, 400, 556, 692, 198, 1119, 3126, 2072, 1779, 1737, 7596, 2913, 3246, 2101, 3598, 7651, 4383, 4294, 3457, 8284, 14220, 11986, 15101, 3204, 32808, 18217, 16273, 42990, 22303, 37037, 13729, 43117, 32820, 70501
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 appearance of 2n at (A376520):
  2, 3, 8, 22, 32, 42, 28, 259, 91, 141, 172, 242, 341, 400, 556, 692, 198, 1119, ...
		

Crossrefs

This is the position of first appearance of 2n in A037201.
For positions of twos instead of first appearances we have A376343.
The sorted version is A376521.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259 (ones A375927).
A013929 lists nonsquarefree numbers, differences A078147.
A116861 counts partitions by compressed sum, compositions A373949.
A116608 counts partitions by compressed length, compositions A333755.
A274174 counts contiguous compositions, ranks A374249.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.

Programs

  • Mathematica
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=First/@Split[Differences[Select[Range[10000],PrimeQ]]];
    Table[Position[q,2k][[1,1]],{k,mnrm[Rest[q]/2]}]

A283371 Maximum number of pairs of primes (p, q) such that p < q = < prime (n) and q - p = constant.

Original entry on oeis.org

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

Views

Author

Andres Cicuttin, Mar 06 2017

Keywords

Comments

Maximum number of different ways of expressing a positive number as a difference of two distinct primes less than or equal to prime(n).
Is there any n such that a(n+1) - a(n) > 1?
What is the asymptotic behavior of a(n)?
To answer the first question: for all n, either a(n+1) = a(n) or a(n+1) = a(n) + 1. - Charles R Greathouse IV, Mar 06 2017

Examples

			a(1)=0 because there are no two distinct primes less than or equal to prime(1)=2.
a(2)=1 because there are only two distinct primes less than or equal to prime(2)=3, and then there is only one positive difference among them: 3 - 2 = 1.
a(3)=1 because the three pairs of distinct primes less than or equal to prime(3)=5, i.e., (2,3), (3,5), and (2,5), produce different positive differences: 3 - 2 = 1, 5 - 3 = 2, and 5 - 2 = 3.
a(4)=2 because among all pairs of distinct primes taken from the first four primes, 2, 3, 5, and 7, there are two pairs with same positive difference, i.e., 7 - 5 = 5 - 3 = 2.
a(6)=3 because among all pairs of distinct primes taken from the first six primes, 2, 3, 5, 7, 11, and 13, there are at most three pairs with the same positive difference, i.e., 13 - 11 = 7 - 5 = 5 - 3 = 2.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{fp,fps,fpst,fpstts,fpsttst},
    fp=Prime[Range[n]];
    fps=Subsets[fp,{2}];
    fpst=Table[Abs@(fps[[j]][[2]]-fps[[j]][[1]]),{j,1,Length[fps]}];
    fpstts=fpst//Tally;
    If[n<2,0,fpsttst=fpstts//Transpose;fpsttst[[2]]//Max]//Return];
    Table[a[n],{n,1,120}]
  • PARI
    first(n)=my(v=vector(n),P=primes(n),H=vectorsmall((P[#P]-P[2])/2,i,0)); v[2]=1; for(n=3,#P, for(i=2,n-1,H[(P[n]-P[i])/2]++); v[n]=vecmax(H)); v \\ Charles R Greathouse IV, Mar 06 2017

Formula

a(n) >> n/log n. In particular, lim inf a(n) * (log n)/n >= 1/2. - Charles R Greathouse IV, Mar 06 2017

A089730 Greatest prime factor of all differences prime(n)-q, q prime and q

Original entry on oeis.org

0, 1, 3, 5, 3, 11, 7, 17, 7, 13, 29, 17, 19, 41, 17, 23, 23, 59, 31, 29, 71, 37, 23, 43, 47, 47, 101, 47, 107, 53, 61, 59, 67, 137, 73, 149, 73, 79, 53, 83, 83, 179, 89, 191, 97, 197, 103, 109, 107, 227, 113, 113, 239, 107, 127, 113, 131, 269, 137, 139, 281, 137
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2004

Keywords

Examples

			n=10, prime(n)=29: a(10) = Max(Union(Factors(29-prime(i)):i<10)) = Max(Factors(27) u Factors(26) u Factors(24) u Factors(22) u Factors(18) u Factors(16) u Factors(12) u Factors(10) u Factors(6)) = Max({3} u {2,13} u {2,3} u {2,11} u {2,3} u {2} u {2,3} u {2,5} u {2,3}) = Max{2,3,5,11,13} = 13.
		

Crossrefs

A173672 Positive differences between any two primes without the differences that are semiprimes.

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 12, 16, 17, 18, 20, 24, 27, 28, 29, 30, 32, 36, 40, 41, 42, 44, 45, 48, 50, 52, 54, 56, 59, 60, 64, 66, 68, 70, 71, 72, 76, 78, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 101, 102, 104, 105, 107, 108, 110, 112, 114, 116, 120, 124, 125, 126, 128, 130, 132, 135, 136, 137, 138, 140, 144, 147, 148
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 24 2010

Keywords

Crossrefs

Formula

A030173 \ A001358. [R. J. Mathar, Nov 25 2010]

Extensions

Sequence corrected by R. J. Mathar, Nov 25 2010
Previous Showing 11-14 of 14 results.