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 31-40 of 41 results. Next

A113784 Difference between semiprime(n) and semiprime(n+2).

Original entry on oeis.org

5, 4, 5, 5, 7, 7, 4, 4, 8, 8, 2, 4, 4, 8, 10, 5, 6, 6, 3, 5, 7, 7, 9, 8, 8, 8, 4, 2, 5, 6, 3, 2, 12, 16, 9, 7, 4, 3, 3, 2, 7, 10, 5, 8, 8, 2, 3, 3, 10, 12, 4, 3, 7, 8, 11, 9, 6, 7, 4, 9, 14, 8, 2, 3, 3, 4, 7, 5, 2, 3, 3, 2, 3, 7, 14, 11, 12, 12, 6, 5, 6, 8, 6, 5, 9, 11, 13, 11, 4, 6, 7, 4, 3, 3, 2, 3, 6, 9
Offset: 1

Views

Author

Jonathan Vos Post, Jan 20 2006

Keywords

Comments

Semiprime analog of A031131 "Difference between n-th prime and (n+2)nd prime."

Examples

			a(1) = 5 because 3rd semiprime - first semiprime = 9 - 4 = 5.
a(2) = 4 because semiprime(4) - semiprime(2) = 10 - 6 = 4.
a(3) = 5 because semiprime(5) - semiprime(3) = 14 - 9 = 5.
a(4) = 5 because semiprime(6) - semiprime(4) = 15 - 10 = 5.
		

Crossrefs

Programs

  • Mathematica
    t = Select[ Range@320, Plus @@ Last /@ FactorInteger@# == 2 &]; Drop[t, 2] - Drop[t, -2] (* Robert G. Wilson v *)

Formula

a(n) = A001358(n+2) - A001358(n).

Extensions

More terms from Robert G. Wilson v, Jan 21 2006

A115401 Record differences between prime(n+3) and prime(n). Records in A031165.

Original entry on oeis.org

5, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 40, 42, 46, 50, 54, 58, 60, 62, 64, 68, 78, 84, 112, 116, 118, 120, 126, 128, 142, 152, 170, 178, 184, 192, 194, 198, 208, 210, 216, 220, 222, 252, 258, 270, 300, 318, 336, 348, 354, 370, 408
Offset: 1

Views

Author

Jonathan Vos Post, Jan 22 2006

Keywords

Comments

This is the k=3 case of the set of sequences "records in a(k,n) = prime(n+k) - prime(n)." The k=1 case is given by A005250 (ncreasing gaps between primes), A000101 [increasing gaps between primes (upper end)] and A002386, which gives lower ends of these gaps. The k=2 case is A031132. The merits of these records are (prime(n+3)-prime(n))/log (prime(n)). The first record merit is 5/log 2 = 16.6096405. The second record merit is 8/log 3 = 16.7672262.

Examples

			a(1) = A031165(1) = prime(4) - prime(1) = 7 - 2 = 5, which is the only odd element of this sequence.
a(2) = A031165(2) = prime(5) - prime(2) = 11 - 3 = 8.
a(3) = A031165(4) = prime(7) - prime(4) = 17 - 7 = 10.
a(4) = A031165(7) = prime(10) - prime(7) = 29 - 17 = 12.
a(5) = A031165(9) = prime(12) - prime(9) = 37 - 23 = 14.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; d = 0; p = 1; q = 2; r = 3; s = 5; lst = {}; Do[{p, q, r, s} = {q, r, s, NextPrim[s]}; If[s > d + p, d = s - p; AppendTo[lst, d]; Print[d]], {n, 10^8}] (* Robert G. Wilson v *)

Extensions

Corrected and extended by Robert G. Wilson v, Jan 23 2006

A161782 a(n) = sum of all numbers from and including (prime(n+1)-prime(n)) to and including (prime(n+2)-prime(n).)

Original entry on oeis.org

6, 9, 20, 15, 20, 15, 20, 49, 21, 35, 40, 15, 20, 49, 63, 21, 35, 40, 15, 35, 40, 49, 90, 50, 15, 20, 15, 20, 165, 80, 49, 21, 77, 33, 35, 63, 40, 49, 63, 21, 77, 33, 20, 15, 104, 234, 70, 15, 20, 49, 21, 77, 91, 63, 63, 21, 35, 40, 15, 77, 255, 80, 15, 20, 165, 119, 121, 33
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 20 2009

Keywords

Examples

			n = 1: prime(1) = 2, prime(2) = 3, prime(3) = 5. Sum of all numbers from prime(2)-prime(1) = 1 to prime(3)-prime(1) = 3 is 1+2+3, hence a(1) = 6.
n = 11: prime(11) = 31, prime(12) = 37, prime(13) = 41. Sum of all numbers from prime(12)-prime(11) = 6 to prime(13)-prime(11) = 10 is 6+7+8+9+10, hence a(11) = 40.
		

Crossrefs

Cf. A001223 (differences between consecutive primes), A031131 (difference between n-th prime and (n+2)nd prime).

Programs

  • Magma
    [ &+[(NthPrime(n+1)-NthPrime(n))..(NthPrime(n+2)-NthPrime(n))]: n in [1..68] ];
  • Mathematica
    Total[Range[#[[2]]-#[[1]],#[[3]]-#[[1]]]]&/@Partition[Prime[Range[70]],3,1] (* Harvey P. Dale, Oct 18 2021 *)

Formula

a(n) = Sum_{x=prime(n+1)-prime(n)..prime(n+2)-prime(n)} x = Sum_{x=A001223(n)..A031131(n)} x.

Extensions

Edited and extended beyond a(33) by Klaus Brockhaus, Jun 23 2009
Definition clarified by Harvey P. Dale, Oct 18 2021

A161811 Difference between nonprime(n+2) and nonprime(n).

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jun 20 2009

Keywords

Comments

"nonprime(n)" is used for "n-th nonprime". Here the nonprimes start at 0 (see A141468), so nonprime(1) to nonprime(15) are 0, 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22.

Examples

			nonprime(1+2)-nonprime(1) = 4-0; so a(1) = 4.
nonprime(5+2)-nonprime(5) = 10-8; so a(5) = 2.
nonprime(11+2)-nonprime(11) = 20-16; so a(11) = 4.
		

Crossrefs

Programs

  • Mathematica
    #[[3]]-#[[1]]&/@Partition[Select[Range[0,150],!PrimeQ[#]&],3,1] (* Harvey P. Dale, Jul 08 2022 *)

Formula

a(n) = A141468(n+2)-A141468(n).

Extensions

Edited, corrected (a(11)=2 replaced by 4) and extended by Klaus Brockhaus, Jun 24 2009

A261518 a(n+1) = prime(n + a(n)) - prime(n), a(1) = 1.

Original entry on oeis.org

1, 1, 2, 6, 22, 92, 508, 3674, 34452, 408104, 5925564, 103023888, 2102941162, 49588317960, 1332831700026, 40376512041704, 1365483356241318, 51130344360226830, 2104788801045148866, 94659739599219674872, 4625501078986781603540, 244380566194237434434094
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 23 2015

Keywords

Crossrefs

Programs

  • Haskell
    a261518 n = a261518_list !! (n - 1)
    a261518_list = 1 : zipWith (-)
                   (map a000040 (zipWith (+) a261518_list [1..])) a000040_list
    
  • Magma
    [1] cat [n le 1 select 1 else  NthPrime(n + Self(n-1)) - NthPrime(n): n in [1..12]]; // Vincenzo Librandi, Aug 24 2015
    
  • Mathematica
    FoldList[(Prime[#2+#1]-Prime[#2])&,1,Range@15] (* Ivan N. Ianakiev, Aug 23 2015 *)
    RecurrenceTable[{a[n+1] == Prime[n+a[n]] - Prime[n], a[1]==1}, a, {n, 1,16}] (* G. C. Greubel, Aug 24 2015 *)
    nxt[{n_,a_}]:={n+1,Prime[n+a]-Prime[n]}; NestList[nxt,{1,1},16][[All,2]] (* Harvey P. Dale, May 15 2018 *)
  • PARI
    a(n) = if(n==1, 1, prime(n-1 + a(n-1)) - prime(n-1));
    vector(12, n, a(n)) \\ Altug Alkan, Oct 05 2015
    
  • Python
    # see LINKS

Extensions

a(13)-a(16) from Ivan N. Ianakiev, Aug 23 2015
a(17)-a(19) from Jinyuan Wang, Jun 27 2020
a(20)-a(22) from Lucas A. Brown, Mar 18 2024

A338425 Numbers k such that the points [prime(k), prime(k+1)], [prime(k+2), prime(k+3)] and [prime(k+4), prime(k+5)] are collinear.

Original entry on oeis.org

3, 4, 25, 27, 41, 54, 103, 124, 140, 147, 149, 151, 186, 247, 271, 306, 345, 347, 354, 377, 398, 430, 464, 473, 504, 577, 578, 670, 682, 709, 767, 771, 787, 821, 823, 825, 827, 870, 1037, 1086, 1124, 1157, 1165, 1167, 1276, 1319, 1388, 1401, 1557, 1600, 1602, 1607, 1722, 1724, 1740, 1828, 1830
Offset: 1

Views

Author

Robert Israel, Oct 25 2020

Keywords

Comments

Numbers k such that A031131(k)*A031131(k+3)=A031131(k+1)*A031131(k+2).

Examples

			a(3)=25 is in the sequence because the six primes starting with prime(25)=97 are 97, 101, 103, 107, 109, 113, and the points (97,101), (103,107) and (109,113) are collinear, all being on the line y=x+4.
		

Crossrefs

Cf. A031131.

Programs

  • Maple
    P:= [seq(ithprime(i), i=1..2005)]:
    select(n -> (P[n+2]-P[n])*(P[n+5]-P[n+1]) = (P[n+3] - P[n+1])*(P[n+4]-P[n]), [$1..2000]);

A084856 Prime(n+2)^2-prime(n)^2.

Original entry on oeis.org

21, 40, 96, 120, 168, 192, 240, 480, 432, 528, 720, 480, 528, 960, 1272, 912, 1008, 1320, 840, 1200, 1560, 1680, 2520, 2280, 1200, 1248, 1272, 1320, 4248, 4392, 2640, 2160, 3432, 3480, 2448, 3768, 3240, 3360, 4152, 2832, 4440, 4488, 2328, 2352, 5712
Offset: 1

Views

Author

Meir Avshalomi (amomy(AT)yahoo.com), Jul 13 2003

Keywords

Examples

			a(3)=prime(5)^2-prime(3)^2= 11^2-5^2=96
		

Programs

  • Mathematica
    Table[ Prime[n + 2]^2 - Prime[n]^2, {n, 1, 45}]

Formula

Extensions

Edited and extended by Robert G. Wilson v, Jul 19 2003

A110934 Difference between 3-almostprime(n) and 3-almostprime(n+2).

Original entry on oeis.org

10, 8, 9, 8, 3, 14, 14, 3, 6, 7, 13, 14, 5, 4, 7, 6, 3, 16, 20, 7, 4, 6, 8, 9, 6, 3, 8, 8, 6, 13, 17, 10, 6, 6, 11, 11, 6, 6, 2, 3, 3, 8, 11, 6, 4, 7, 17, 17, 15, 18, 9, 6, 7, 6, 6, 3, 2, 10, 12, 6, 8, 7, 7, 7, 6, 7, 5, 3, 2, 5, 6, 20, 24, 8, 6, 7, 10, 8, 6, 10, 7
Offset: 1

Views

Author

Jonathan Vos Post, Jan 21 2006

Keywords

Comments

This is the 3-almost prime analog of what A113784 is for semiprimes and what A031131 is for primes. The minimum values in the sequence are 2 because we have, for example, the 3 consecutive 3-almost primes 170, 171, 172, so a(39) = A014612(41) - A014612(39) = 172 - 170 = 2. Equivalently, there are 2 consecutive 1 values of A114403 (3-almost prime gaps; first differences of A014612). This happens for elements of A113789 (numbers n such that n, n+1 and n+2 are 3-almost primes).

Examples

			a(1) = 10 because the difference between the first and third 3-almost primes is A014612(3) - A014612(1) = 18 - 8 = 10.
a(2) = A014612(4) - A014612(2) = 20 - 12 = 8.
a(3) = A014612(5) - A014612(3) = 27 - 18 = 9.
		

Crossrefs

Formula

a(n) = A014612(n+2) - A014612(n).

Extensions

a(28) corrected by R. J. Mathar, Dec 22 2010

A214612 prime(n^3) - prime(n).

Original entry on oeis.org

0, 16, 98, 304, 680, 1308, 2292, 3652, 5496, 7890, 10926, 14716, 19362, 24766, 31272, 38820, 47598, 57498, 68964, 81728, 96064, 112212, 129990, 149628, 171432, 194942, 220758, 248744, 279322, 312470, 347580, 385962, 427032, 470794, 517404, 567720, 620374
Offset: 1

Views

Author

Jonathan Vos Post, Mar 06 2013

Keywords

Comments

This is to exponent 3 as A213926 is to exponent 2.

Examples

			a(1) = prime(1^3) - prime(1) = 2-2 = 0.
a(2) = prime(2^3) - prime(2) = 19-3 = 16.
a(3) = prime(3^3) - prime(3) = 103-5 = 98.
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[n^3] - Prime[n], {n, 50}] (* T. D. Noe, Mar 07 2013 *)

A261468 a(n) = prime(n+2) mod prime(n).

Original entry on oeis.org

1, 1, 1, 6, 6, 6, 6, 10, 8, 8, 10, 6, 6, 10, 12, 8, 8, 10, 6, 8, 10, 10, 14, 12, 6, 6, 6, 6, 18, 18, 10, 8, 12, 12, 8, 12, 10, 10, 12, 8, 12, 12, 6, 6, 14, 24, 16, 6, 6, 10, 8, 12, 16, 12, 12, 8, 8, 10, 6, 12, 24, 18, 6, 6, 18, 20, 16, 12, 6, 10, 14, 14, 12
Offset: 1

Views

Author

Altug Alkan, Aug 20 2015

Keywords

Examples

			a(3) = 11 mod 5 = 1.
		

Crossrefs

Cf. A031131.

Programs

  • Magma
    [NthPrime(n+2) mod NthPrime(n): n in [1..80]]; // Vincenzo Librandi, Aug 20 2015
  • Mathematica
    a[n_]:=PowerMod[Prime[n + 2], 1, Prime[n]]; Table[a[n], {n, 80}] (* Vincenzo Librandi, Aug 20 2015 *)
    Mod[#[[3]],#[[1]]]&/@Partition[Prime[Range[80]],3,1] (* Harvey P. Dale, Mar 14 2020 *)
  • PARI
    first(m)=vector(m,i,prime(i+2)% prime(i)); \\ Anders Hellström, Aug 20 2015
    

Formula

a(n) = A031131(n) = A075527(n) for n>3. - Alois P. Heinz, Aug 20 2015
Previous Showing 31-40 of 41 results. Next