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.

A098214 Sequence of special consecutive prime differences which can be arranged into rows of distinct differences with k=1,2,3,...length. Each row is obtained from segment of k+1 consecutive primes started with A079007[k].

Original entry on oeis.org

1, 1, 2, 2, 4, 6, 6, 8, 4, 2, 14, 4, 6, 2, 10, 8, 4, 6, 12, 2, 18, 6, 8, 18, 10, 14, 4, 2, 10, 12, 8, 16, 14, 6, 4, 2, 10, 2, 16, 6, 20, 4, 12, 14, 28, 4, 14, 22, 12, 2, 18, 10, 6, 26, 24, 14, 16, 6, 20, 10, 12, 2, 18, 42, 4, 24, 18, 6, 4, 20, 22, 8, 12, 24, 16, 14, 10, 30, 6, 4, 20, 22, 8, 12
Offset: 1

Views

Author

Labos Elemer, Oct 21 2004

Keywords

Comments

Rows generated by n-th term of A079007 are all distinct. See definition of A079007.

Examples

			Triangle begins:
1,
1,2,
2,4,6,
6,8,4,2,
14,4,6,2,10,
8,4,6,12,2,18,
6,8,18,10,14,4,2,
10,12,8,16,14,6,4,2,
10,2,16,6,20,4,12,14,28,
4,14,22,12,2,18,10,6,26,24,
14,16,6,20,10,12,2,18,42,4,24,
18,6,4,20,22,8,12,24,16,14,10,30,
6,4,20,22,8,12,24,16,14,10,30,18,2,
16,8,22,26,4,24,20,6,58,12,14,10,36,18,
16,8,22,26,4,24,20,6,58,12,14,10,36,18,2,
The 6th row {8,4,6,12,2,18}={a[16],...a[21]} is obtained as first
difference sequence of 7 primes started with prime[94]=491=A079007[6].
The k-th row starts and ends with terms a[1+k(k-1)/2] and a[ -1+k+k(k-1)/2].
		

Crossrefs

A053597 Let prime(i) = i-th prime (A000040), let d(i) = prime(i+1)-prime(i) (A001223); a(n) = number of distinct numbers among d(n), d(n+1), d(n+2), ... before first duplicate is encountered.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 07 2003

Keywords

Examples

			The d sequence starting at prime(7) = 17 is d(7) = 2, d(8) = 4, d(9) = 6, d(10) = 2, with three numbers before the first duplication, so a(7) = 3.
		

Crossrefs

A078515 gives RECORDS transform of this sequence. See also A079007.

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..1000)]:
    G:= P[2..-1]-P[1..-2]:
    R:= Vector(990):
    for i from 1 to 990 do
      for k from 1 while nops(convert(G[i..i+k-1],set))=k do od:
      R[i]:= k-1;
    od:
    convert(R,list);
  • Mathematica
    f[n_] := Block[{k = 1}, While[p = Table[ Prime[i], {i, n, n + k}]; Length[ Union[ Drop[p, 1] - Drop[p, -1]]] == k, k++ ]; k - 1]; Table[ f[n], {n, 1, 105}]

Extensions

More terms from Robert G. Wilson v, Jan 07 2002

A078515 Numbers n such that A053597(n) sets a new record.

Original entry on oeis.org

1, 7, 23, 30, 94, 219, 279, 773, 1856, 3724, 6999, 7000, 19205, 184163, 280103, 849876, 1870722, 3570761, 4114341, 11271072, 55282774, 68256040, 68256041, 104011359, 1009322491, 1311699253, 7889803997
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2003

Keywords

Crossrefs

Gives RECORDS transform of A053597. The corresponding primes are in A079889. See also A079007.

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[p = Table[ Prime[i], {i, n, n + k}]; Length[ Union[Drop[p, 1] - Drop[p, -1]]] == k, k++ ]; k - 1]; a = Table[0, {50}]; Do[b = f[n]; If[ a[[b]] == 0, a[[b]] = n], {n, 1, 19000000}]

Extensions

More terms from Robert G. Wilson v and Klaus Brockhaus, Jan 08 2003
a(21)-a(27) from Donovan Johnson, Oct 23 2012

A079889 Primes indexed by A078515; i.e., primes which start record runs of consecutive primes with distinct first differences.

Original entry on oeis.org

2, 17, 83, 113, 491, 1367, 1801, 5869, 15919, 34883, 70639, 70657, 214867, 2515871, 3952733, 13010143, 30220163, 60155567, 69931991, 203674907, 1092101119, 1363592621, 1363592677, 2124140323, 23024158649, 30282104173, 196948778371
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2003

Keywords

Examples

			2, 17 and 83 are in the sequence because the 3 consecutive primes 2,3,5 have distinct first differences 1,2, the 4 consecutive primes 17,19,23,29 have distinct differences 2,4,6, and the 5 consecutive primes 83,89,97,101,103 have distinct differences 6,8,4,2.
		

Crossrefs

Cf. A078515, A078516. Same as A079007 with duplicates removed.

Formula

a(n) = A078515(n)-th prime.

Extensions

More terms from Don Reble, Jan 15 2003
a(25)-a(27) from Donovan Johnson, Oct 23 2012

A098213 The values of some algorithm.

Original entry on oeis.org

1, 1, 1, 8, 30, 97, 374, 2185, 7399, 60475, 303535, 2332720, 16630294, 41419087, 599216396
Offset: 1

Views

Author

Labos Elemer, Oct 05 2004

Keywords

Comments

The algorithm: Take n consecutive primes starting with the a(n)-th prime: {p(a(n)), ..., p(a(n)+n-1)}. Calculate the absolute differences abs(p(i)-p(j)) for all relevant pairs i,j. The number of distinct entries of this n X n difference matrix equals binomial(n,2) = n(n-1)/2, the maximum possible. Also a(n) is the earliest index such that this diversity of differences reaches the maximum possible, binomial(n,2).
The diagonal [{p(i)-p(i)}] of difference matrices consists only of zeros and can be disregarded.
The complete diversity of k-1 consecutive prime differences [as in A079007] is a necessary but not sufficient condition for providing binomial(k,2) distinct entries in the corresponding k X k difference matrix of k consecutive primes. Consecutive prime differences are para-diagonal entries in the difference matrix. So the conditions here are stronger than in A079007.
Subscripts at which sequences like A098726, A098206-A098212 reach first their possible maximum, i.e., binomial(k,2) with the corresponding k.

Examples

			At n = 1, 2, 3, the maxima are binomial(n,2) = 0, 1, 3 reached at a(n) = 1, 1, 1 respectively.
For n = 7: a(7) = 374, primes = {p(374), ..., p(80)} = {2551, 2557, 2579, 2591, 2593, 2609, 2617}. Building the 7 X 7 matrix of values of abs(p(i)-p(j)), the number of its distinct positive entries equals binomial(7,2)=21, namely: {2, 6, 8, 12, 14, 16, 18, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 52, 58, 60, 66}.
For n = 12: a(12) = 2332720, list of 12 primes = {p(n), ..., p(n+11)} = {38238461, ..., 38238737}. 12 X 12 matrix = {abs(p(i)-p(j))}, number of distinct entries = binomial(12,2) = 66, that of {2, 6, 8, ..., 266, 274, 276}.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1, v = Prime[Range[n]]}, While[CountDistinct@ Flatten@ Abs@ Outer[Plus, v, -v] - 1 != Binomial[n, 2], k++; v = Join[v[[2 ;; -1]], {NextPrime[v[[-1]]]}]]; k]; Array[a, 10] (* Amiram Eldar, Feb 23 2025 *)
  • PARI
    s(v) = {my(d = List()); for(i = 1, #v, for(j = 1, i-1, listput(d, abs(v[i] - v[j])))); #Set(d);}
    a(n) = {my(k = 1, v = primes(n), t = n*(n-1)/2, j = 1); while(s(v) != t, k++; v[j] = nextprime(1 + if(j==1, v[n], v[j-1])); j++; if(j > n, j -= n)); k;} \\ Amiram Eldar, Feb 23 2025

Formula

a(n) = PrimePi(A099640(n)). - Amiram Eldar, Feb 23 2025

Extensions

Edited by Jon E. Schoenfield, Oct 27 2019
a(14)-a(15) from Amiram Eldar, Feb 23 2025

A033624 Primes and gaps for the first 20 distinct consecutive gaps.

Original entry on oeis.org

60155567, 30, 60155597, 14, 60155611, 48, 60155659, 28, 60155687, 56, 60155743, 16, 60155759, 2, 60155761, 46, 60155807, 12, 60155819, 38, 60155857, 4, 60155861, 6, 60155867, 32, 60155899, 24, 60155923, 10, 60155933, 18, 60155951, 8, 60155959, 22, 60155981, 20, 60156001, 36, 60156037
Offset: 0

Views

Author

Keywords

Crossrefs

60155567 = A079007(20).

Extensions

More terms from Sean A. Irvine, Jul 08 2020

A079008 a(n) is smallest number k such that the n successive values of phi(k+j) (j=0,..,n-1) are all distinct.

Original entry on oeis.org

1, 2, 5, 11, 11, 17, 17, 37, 46, 46, 112, 112, 123, 149, 149, 149, 257, 257, 257, 257, 257, 257, 257, 261, 658, 658, 685, 741, 741, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 4097, 4097, 4097, 4097, 4097
Offset: 1

Views

Author

Labos Elemer, Jan 08 2003

Keywords

Examples

			a(8)=37, values of phi(k) for k=37,..,44 are {36, 18, 24, 16, 40, 12, 42, 20}.
		

Crossrefs

Programs

  • Mathematica
    kul[x_] := Length[x]-Length[Union[x]]; frt[x_] := Table[EulerPhi[x+j], {j, 0, h-1}]; Table[fa=1; k=0; Do[s=frt[n]; s1=kul[s]; If[Equal[s1, 0]&&Equal[fa, 1], k=k+1; Print[{h, n, s}]; fa=0], {n, 1, 10000}], {h, 1, 50}]
  • PARI
    a(n) = if(n==1, 1, my(v=vector(n, i, eulerphi(i))); for(k=n, oo, if(#Set(v)==n, return(k-n)); v[k%n+1]=eulerphi(k))); \\ Jinyuan Wang, Feb 10 2021

A079009 Least k such that the 2^n successive values of phi(k+j) (j=0..2^n-1) are all distinct.

Original entry on oeis.org

1, 2, 11, 37, 149, 1359, 14130, 175327, 1218073, 108387730, 14305141265
Offset: 0

Views

Author

Labos Elemer, Jan 10 2003

Keywords

Examples

			For n = 7: a(7) = 175327 because phi(175327+j), for j=0..127 are all distinct: {175326, 87648, ..., 175452, 85320}.
		

Crossrefs

Programs

  • PARI
    isdist(v) = forstep(i = #v, 1, -1, forstep(j = i - 1, 1, -1, if(v[i] == v[j], return(j)))); 0;
    a(n) = {my(m = 2^n, phis = vector(m, i, eulerphi(i)), k = m, ind = isdist(phis)); while(ind != 0, phis = concat(vecextract(phis, Str("^1.."ind)), vector(ind, i, eulerphi(k+i))); k += ind; ind = isdist(phis)); k - m + 1;} \\ Amiram Eldar, Aug 27 2024

Formula

a(n) = A079008(2^n).

Extensions

a(8)-a(9) from Donovan Johnson, Oct 27 2008
a(10) from Donovan Johnson, Nov 13 2010

A099640 Primes with subscripts described in A098213.

Original entry on oeis.org

2, 2, 2, 19, 113, 509, 2551, 19267, 75041, 753143, 4310819, 38238461, 307379717, 805592213, 13341291553
Offset: 1

Views

Author

Labos Elemer, Oct 29 2004

Keywords

Comments

These primes are the smallest ones that introduce consecutive prime segments of length n, providing "maximum-diversity matrices". See A098213.

Examples

			For n = 7: prime list = {2551,2557,2579,2591,2593,2609,2617}, consecutive differences = {6,22,12,2,16,8}, 7 X 7 matrix = [{abs(p(i)-p(j))], C[7,2] = 21 distinct positive matrix entries: {2,6,8,12,14,16,18,22,24,26,28,30,34,36,38,40,42,52,58,60,66}.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{v = Prime[Range[n]]}, While[CountDistinct@ Flatten@ Abs@ Outer[Plus, v, -v] - 1 != Binomial[n, 2], v = Join[v[[2 ;; -1]], {NextPrime[v[[-1]]]}]]; v[[1]]]; Array[a, 10] (* Amiram Eldar, Feb 23 2025 *)
  • PARI
    s(v) = {my(d = List()); for(i = 1, #v, for(j = 1, i-1, listput(d, abs(v[i] - v[j])))); #Set(d);}
    a(n) = {my(v = primes(n), t = n*(n-1)/2, j = 1); while(s(v) != t, v[j] = nextprime(1 + if(j==1, v[n], v[j-1])); j++; if(j > n, j -= n)); v[j];} \\ Amiram Eldar, Feb 23 2025

Formula

a(n) = prime(A098213(n)). See explanations at A098213.

Extensions

a(14)-a(15) from Amiram Eldar, Feb 23 2025

A372550 Primes such that the next 10 prime gaps are all distinct.

Original entry on oeis.org

15919, 15923, 24113, 24517, 30509, 34883, 34897, 36107, 49201, 52747, 56249, 64927, 64937, 66107, 66109, 66191, 67247, 67261, 67271, 67273, 68147, 70639, 70657, 70663, 70667, 70687, 70709, 70717, 71549, 75797, 78317, 78929, 79979, 81083, 81101, 83701, 88301, 94117, 94603, 94613, 96497, 97609
Offset: 1

Views

Author

Zak Seidov and Robert Israel, May 05 2024

Keywords

Examples

			a(3) = 24113 is a term because it is prime, the next 10 primes are 24121, 24133, 24137, 24151, 24169, 24179, 24181, 24197, 24203, 24223, and the gaps between these 11 primes are 8, 12, 4, 14, 18, 10, 2, 16, 6, 20 which are all distinct.
		

Crossrefs

Cf. A079007.

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..11)]:
    R:= NULL: count:= 0:
    while count < 100 do
      P:= [op(P[2..-1]),nextprime(P[-1])];
      if nops(convert(P[2..-1]-P[1..-2],set))=10 then
        count:= count+1; R:= R,P[1];
      fi
    od:
    R;
  • Mathematica
    s = {};
    Do[If[10 == Length[Union[Differences[Prime[Range[k, k + 10]]]]], AppendTo[s,
    Prime[k]]], {k,, 10000}]; s
Showing 1-10 of 10 results.