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

A138716 Primes p2 such that p1^2 + p2^3 is an average of twin primes and p1 < p2 are consecutive primes.

Original entry on oeis.org

29, 107, 1481, 1613, 2393, 2879, 4421, 5021, 5519, 5573, 6269, 7817, 8447, 9629, 11489, 11981, 12011, 17159, 17573, 18461, 19961, 21713, 23021, 23291, 23747, 24917, 26339, 27947, 29021, 29201, 29663, 30893, 32063, 32717, 34217, 34589, 35159, 36527, 36899, 44753
Offset: 1

Views

Author

Keywords

Examples

			29 is a term since 23 and 29 are consecutive primes, 23^2 + 29^3 = 24918, and (24917, 24919) are twin primes.
		

Crossrefs

Programs

  • Magma
    [NthPrime(k+1):k in [1..5000]| IsPrime(q-1) and IsPrime(q+1) where q is NthPrime(k)^2+ NthPrime(k+1)^3]; // Marius A. Burtea, Dec 22 2019
  • Mathematica
    a={};Do[p1=Prime[n];p2=Prime[n+1];pp=p1^2+p2^3;If[PrimeQ[pp-1]&&PrimeQ[pp+1],AppendTo[a,p2]],{n,16^3}];Print[a];
    Select[Partition[Prime[Range[5000]],2,1],AllTrue[#[[1]]^2+#[[2]]^3+{1,-1},PrimeQ]&] [[All,2]] (* Harvey P. Dale, Oct 29 2022 *)

Extensions

More terms from Amiram Eldar, Dec 22 2019

A139777 Average of twin primes p4 = p1^3 + p2^2 such that p1 < p2 are consecutive primes and p3 = p1^2 + p2^3 is also an average of twin primes.

Original entry on oeis.org

13008, 9268057799643918, 1151303780719281840798, 1166398496059056623580, 1408815704665167877050, 1611023943160530038112, 1839284737645145603808, 1876391173984974899670, 2541672151459722294708, 3760269231809150191932, 13232137801909374644760, 19086525662779517405622
Offset: 1

Views

Author

Keywords

Examples

			13008 = 23^3 + 29^2 is a term since 23 and 29 are consecutive primes, (13007, 13009) are twin primes, 23^2 + 29^3 = 24918, and (24917, 24919) are also twin primes.
		

Crossrefs

Programs

  • Mathematica
    a={};Do[p1=Prime[n];p2=Prime[n+1];p3=p1^2+p2^3;p4=p1^3+p2^2;If[PrimeQ[p3-1]&&PrimeQ[p3+1]&&PrimeQ[p4-1]&&PrimeQ[p4+1],AppendTo[a,p4]],{n,13^5}];Print[a];

Extensions

More terms from Amiram Eldar, Dec 22 2019

A139780 Average of twin primes of the form p1^3 + p2^2, where p1 < p2 are twin primes.

Original entry on oeis.org

38318210940, 68484878220, 143165125680, 6353554336290, 75041090138100, 91851874324800, 116366750976990, 118525130067690, 368776631152800, 374826155288910, 431041855258500, 585102141663000, 767853933976740, 834602006112360, 845499208101600, 1560061877051100
Offset: 1

Views

Author

Keywords

Examples

			38318210940 = 3371^3 + 3373^2 is a term since both (3371, 3373) and (38318210939, 38318210941) are twin primes.
		

Crossrefs

Programs

  • Magma
    [q:k in [1..10000]|IsPrime((NthPrime(k)+2)) and IsPrime(q-1)and IsPrime(q+1) where q is NthPrime(k)^3+ (NthPrime(k)+2)^2]; // Marius A. Burtea, Dec 22 2019
  • Mathematica
    a={};Do[p1=Prime[n];p2=Prime[n+1];pp=p1^3+p2^2;If[(p2-p1)==2&&PrimeQ[pp-1]&&PrimeQ[pp+1],AppendTo[a,pp]],{n,10^4}];Print[a];
    Select[#[[1]]^3+#[[2]]^2&/@Select[Partition[Prime[Range[15000]],2,1],#[[2]] - #[[1]]==2&],AllTrue[#+{1,-1},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 01 2021 *)

Extensions

More terms from Amiram Eldar, Dec 22 2019

A171938 Record values in A138753 (a "prime" variation of the Collatz (3n+1) problem).

Original entry on oeis.org

1, 4, 5, 8, 21, 22, 24, 29, 60, 61, 72, 73, 97, 100, 184, 216, 239, 451, 469
Offset: 1

Views

Author

M. F. Hasler, Apr 01 2008

Keywords

Crossrefs

Cf. A124123, A138750-A138754, A138756, A006878 (analog for Collatz problem).

Programs

Formula

A171938 = { A138753(m) | A138753(k) < A138753(m) for all k

Extensions

Originally submitted as A138755, but mislaid by Editor-in-Chief; renumbered and added to OEIS, Oct 24 2010
a(15)-a(19) from Paolo Xausa, Jul 29 2023

A138757 a(n) = A007918(A138750(n)), that is, least prime > n/2 if n=2 (mod 3), > 2n otherwise.

Original entry on oeis.org

2, 2, 2, 7, 11, 3, 13, 17, 5, 19, 23, 7, 29, 29, 7, 31, 37, 11, 37, 41, 11, 43, 47, 13, 53, 53, 13, 59, 59, 17, 61, 67, 17, 67, 71, 19, 73, 79, 19, 79, 83, 23, 89, 89, 23, 97, 97, 29, 97, 101, 29, 103, 107, 29, 109, 113, 29, 127, 127, 31, 127, 127, 31, 127
Offset: 0

Author

M. F. Hasler, Apr 04 2008

Keywords

Comments

This can be considered as an analog of the Collatz (or 3n+1) map on the set of primes, see A138751 and A138754 for details.
Numbers 0,1,2 go immediately to the unique fixed point 2, all others end up in the cycle 7 -> 17 -> 11 -> 7, after a number of iterations given by A138753(A138757(n))-1 (= A138753(n)-2 if n is prime).

Examples

			a(7) = 17 since 7 = 1 (mod 3), thus A138750(7) = 2*7 = 14, nextprime(14) = 17.
a(11) = 7 since 11 = 2 (mod 3), thus A138750(11) = ceiling(11/2) = 6, nextprime(6) = 7.
		

Programs

  • Mathematica
    np1[n_]:=Module[{x=Ceiling[n/2]},If[PrimeQ[x],x,NextPrime[x]]]; np2[n_]:= Module[{x=2n},If[PrimeQ[x],x,NextPrime[x]]]; Table[If[Mod[n,3]==2, np1[n], np2[n]],{n,0,70}] (* Harvey P. Dale, Jul 10 2013 *)
  • PARI
    A138757(n)=nextprime(if(n%3==2,(n+1)\2,2*n))

Formula

a(n) = A007918(A138750(n)).
For p prime, a(p) = A138751(A000720(p))
Showing 1-5 of 5 results.