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

A052351 Least prime in A023200 (lesser of 4-twins) such that the distance to the next 4-twin is 6*n.

Original entry on oeis.org

7, 67, 19, 43, 163, 127, 397, 229, 769, 1489, 673, 9547, 1009, 1783, 1693, 2857, 11677, 23869, 499, 1093, 4003, 28657, 10459, 29383, 12487, 6043, 41647, 7039, 17029, 19207, 15073, 24247, 65839, 29629, 18583, 9883, 66697, 100699, 7243, 53923, 82237, 6217, 76249
Offset: 1

Views

Author

Labos Elemer, Mar 07 2000

Keywords

Comments

a(n) is a "lesser of a 4-twin" prime whose distance to the next twin is 6n.
Both the smallest distance (A052380) and its increment for 4-twins is 6.
The prime a(n)=p is the first which determines a prime quadruple [p, p+4, p+6n, p+6n+4] and difference pattern of [4, 6n-4, 4].

Examples

			a(1) = 7 gives [7, 11,7+6 = 13, 17] with no primes between 11 and 13.
a(5) = 163 specifies [163, 167, 163+30 = 191, 193] with 4 primes between 167 and 193.
		

Crossrefs

Programs

  • Mathematica
    seq[m_] := Module[{p = Prime[Range[m]], d, i, pp, dd, j}, d = Differences[p]; i = Position[d, 4] // Flatten; pp = p[[i]]; dd = Differences[pp]/6; j = TakeWhile[FirstPosition[dd, #] & /@ Range[Max[dd]] // Flatten, ! MissingQ[#] &]; pp[[j]]]; seq[10000] (* Amiram Eldar, Mar 04 2025 *)
  • PARI
    list(len) = {my(s = vector(len), c = 0, p1 = 7, q1 = 0, q2, d); forprime(p2 = 11, , if(p2 == p1 + 4, q2 = p1; if(q1 > 0, d = (q2 - q1)/6; if(d <= len && s[d] == 0, c++; s[d] = q1; if(c == len, return(s)))); q1 = q2); p1 = p2);} \\ Amiram Eldar, Mar 04 2025

Extensions

Name corrected by Amiram Eldar, Mar 04 2025

A172112 Partial sums of A023200.

Original entry on oeis.org

3, 10, 23, 42, 79, 122, 189, 268, 365, 468, 577, 704, 867, 1060, 1283, 1512, 1789, 2096, 2409, 2758, 3137, 3534, 3973, 4430, 4893, 5380, 5879, 6492, 7135, 7808, 8547, 9304, 10073, 10896, 11749, 12608, 13485, 14368, 15275, 16212, 17179, 18188, 19275
Offset: 1

Views

Author

Jonathan Vos Post, Jan 25 2010

Keywords

Comments

Primes in the partial sum begin: a(1) = 3, a(3) = 23, a(5) = 79, a(11) = 577, a(15) = 1283, a(17) = 1789, a(21) = 3137, a(27) = 5879. Of these, the smaller members of cousin prime pairs which appear among the partial sums of smaller member p of cousin prime pairs begin: 3, 79; which are the next in this subset?

Examples

			a(30) = 3 + 7 + 13 + 19 + 37 + 43 + 67 + 79 + 97 + 103 + 109 + 127 + 163 + 193 + 223 + 229 + 277 + 307 + 313 + 349 + 379 + 397 + 439 + 457 + 463 + 487 + 499 + 613 + 643 + 673 = 7808.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Select[Prime[Range[250]],PrimeQ[#+4]&]] (* Harvey P. Dale, Oct 09 2023 *)

Formula

a(n) = SUM[i=i..n] A023200(i) = SUM[i=i..n] {Primes p such that p and p + 4 are both primes}.

Extensions

More terms from Max Alekseyev, Jan 31 2010

A172483 a(n) is the number of cousin primes between p^2 and p*(p+4) where p is the n-th cousin prime A023200(n).

Original entry on oeis.org

2, 1, 1, 2, 5, 4, 4, 2, 6, 4, 7, 7, 5, 9, 12, 13, 14, 14, 9, 12, 10, 11, 13, 20, 16, 15, 16, 15, 23, 19, 22, 26, 27, 28, 26, 22, 20, 27, 25, 27, 28, 26, 35, 29, 29, 29, 30, 45, 30, 36, 22, 30, 39, 39, 40, 44, 44, 43, 34, 38, 36, 48, 54, 43, 38, 43, 49, 45, 47, 53, 38, 51, 51, 62, 56
Offset: 1

Views

Author

Jaspal Singh Cheema, Feb 04 2010

Keywords

Comments

If you graph the order of the consecutive cousin primes along the x-axis (i.e., first pair of cousin primes, second, third,...) and the number of cousin primes in the sequence given above along the y-axis, a clear pattern emerges. As you go farther along the x-axis, greater are the number of consecutive cousin primes, on average, within the interval obtained. If one can prove that there's at least one consecutive cousin prime within each interval, this would imply that cousin primes are infinite. I suspect the number of consecutive primes within each interval will never be zero. Can you prove it?

Examples

			The 1st pair of cousin primes is (3, 7), between 3^2=9 and 3*7=21 there is 2 cousin primes: 13 and 19. So a(1) = 2.
The 2nd pair of cousin primes is (7, 11), between 7^2=49 and 7*11=77 there is 1 cousin prime: 67. So a(2) = 1.
		

References

  • C. C. Clawson, Mathematical Mysteries: The Beauty and Magic of Numbers, Perseus Books, 1999.
  • M. D. Sautoy, The Music of the Primes: Searching to Solve the Greatest Mystery in Mathematics, HarperCollins Publishers Inc., 2004.

Crossrefs

Programs

  • PARI
    vcp(nn) = my(list=List(), p=3); listput(list, p); p=7; forprime(q=11, nn, if(q-p==4, listput(list, p)); p=q); Vec(list); \\ A023200
    nbcp(p) = my(nb=0); forprime(q=p^2, p*(p+4), if (isprime(q+4), nb++)); nb;
    lista(nn) = my(v=vcp(nn)); vector(#v, n, nbcp(v[n])); \\ Michel Marcus, Nov 02 2022

Extensions

New name and a(1)=2 prepended by Michel Marcus, Nov 02 2022

A174046 Places n for which A001359(n) and A023200(n) is a twin prime pair.

Original entry on oeis.org

2, 3, 4, 6, 14, 16, 29, 356, 358, 359, 403, 446, 464, 485, 652, 655, 764, 861, 866, 1123, 1301, 1304, 1324, 1328, 1358, 1486, 1610, 2631, 2632, 3735, 3931, 3953, 3956, 3957, 4679, 4855, 4931, 5222, 5226, 5269, 5283, 5292, 5403, 5427, 5445
Offset: 1

Views

Author

Vladimir Shevelev, Mar 06 2010

Keywords

Examples

			2 is in the sequence because A001359(2)=5 and A023200(2)=7 are twin primes.
		

Crossrefs

Programs

  • PARI
    lista(nn)  = {vp = primes(nn); va = select(x->isprime(x+2), vp); vb = select(x->isprime(x+4), vp); for (n=1, min(#va, #vb), if (vb[n] == va[n]+2, print1(n, ", ")););} \\ Michel Marcus, Jul 22 2017

Extensions

Terms beyond 29 from R. J. Mathar, Nov 03 2011
Edited by Michel Marcus, Jul 22 2017

A352171 a(n) is the start of a sequence of exactly n members of A023200 under the iteration p -> 3*p+4.

Original entry on oeis.org

7, 13, 3, 1547803
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 07 2022

Keywords

Comments

Let s(1) = a(n) and s(k+1) = 3*s(k)+4. Then s(1), ..., s(n) are in A023200 but s(n+1) is not in A023200, and a(n) is the least value of s(n) for which this is the case.

Examples

			a(3) = 3 because with s(1) = 3 we have s(2) = 3*3+4 = 13, s(3) = 3*13+4 = 43, s(4) = 3*43+4 = 133; 3, 13, and 43 are in A023200 because 3, 7, 13, 17, 42, 47 are prime, but 133 is not in A023200 because 133 is composite.
		

Crossrefs

Cf. A023200.

Programs

  • Maple
    f:= proc(p) option remember;
      if isprime(p) and isprime(p+4) then 1 + procname(3*p+4) else 0 fi
    end proc:
    V:= Vector(5): V[1]:= 7: V[3]:= 3: count:= 2:
    for p from 13 by 30 while count < 5 do
    v:= f(p);
    if v > 0 and V[v] = 0 then count:= count+1; V[v]:= p; fi
    od:
    convert(V,list);

A046132 Larger member p+4 of cousin primes (p, p+4).

Original entry on oeis.org

7, 11, 17, 23, 41, 47, 71, 83, 101, 107, 113, 131, 167, 197, 227, 233, 281, 311, 317, 353, 383, 401, 443, 461, 467, 491, 503, 617, 647, 677, 743, 761, 773, 827, 857, 863, 881, 887, 911, 941, 971, 1013, 1091, 1097, 1217, 1283, 1301, 1307, 1427, 1433
Offset: 1

Views

Author

Keywords

Comments

A pair of cousin primes are primes of the form p and p+4 (where p+2 may or may not be a prime). - N. J. A. Sloane, Mar 18 2021

Crossrefs

Essentially the same as A031505. Cf. A023200, A029710, A098429.

Programs

  • Haskell
    a046132 n = a046132_list !! (n-1)
    a046132_list = filter ((== 1) . a010051') $ map (+ 4) a000040_list
    -- Reinhard Zumkeller, Aug 01 2014
  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[p4=p+4], (*Print[p4];*)AppendTo[lst, p4]], {n, 10^2}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)
    Select[Prime[Range[300]],PrimeQ[#+4]&]+4 (* Harvey P. Dale, Dec 15 2017 *)
  • PARI
    forprime(p=2,1e5,if(isprime(p-4),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    

Formula

a(n) = A023200(n) + 4 = A087679(n) + 2.
a(n) = 3*A157834(n-1) + 2 = A029710(n-1) + 4 = 6*A056956(n-1) + 5 (thus a(n) mod 6 == 5), for all n>1. - M. F. Hasler, Jan 15 2013

A007694 Numbers k such that phi(k) divides k.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48, 54, 64, 72, 96, 108, 128, 144, 162, 192, 216, 256, 288, 324, 384, 432, 486, 512, 576, 648, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6912, 7776, 8192, 8748, 9216
Offset: 1

Views

Author

Keywords

Comments

a(n) divides p^a(n) - 1 for all primes p >= 5. - Benoit Cloitre, Mar 22 2002
Also k such that Sum_{d divides k} mu(d)/d has numerator 1. - Benoit Cloitre, Apr 15 2002
k is here if and only if phi(k) also divides cototient(k). On the other hand, cototient(k) divides phi(k) if and only if k is a prime or power of a prime. - Labos Elemer, May 03 2002
It follows that k/phi(k) = 2 if k is a power of 2 and equal to 3 if k is of the form 6*A003586. - Gary Detlefs, Jun 28 2011
1 and even 3-smooth numbers, cf. A003586. - Reinhard Zumkeller, Jan 06 2014
Numbers k such that k = (1+omega(k))*phi(k). - Farideh Firoozbakht, Oct 02 2014
These are the integers whose largest squarefree divisor is 1, 2 or 6. As such, this sequence is equal to the set V_infinite, defined as the intersection of the V_k for k >= 1, where V_k(x) = {phi_k(n) <= x} and phi_k is the k-th iterate of phi, the Euler function; for instance, V_1 is given by A002202 (see Theorem 7 in Pomerance and Luca). - Michel Marcus, Nov 09 2015
This sequence is contained in A068997. The terms of A068997 not in this sequence have largest squarefree divisor other than 1, 2, or 6, beginning with 10. - Torlach Rush, Dec 07 2017

Examples

			12 is in the sequence because 12/phi(12) = 12/4 = 3, which is an integer.
16 is in the sequence because 16/phi(16) = 16/8 = 2, which is an integer.
20 is not in the sequence because 20/phi(20) = 20/8 = 5/2 = 2.5, which is not an integer.
		

References

  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique Des Nombres, Problem 526 pp. 71; 256, Ellipses Paris 2004.
  • Sárközy A. and Suranyi J., Number Theory Problem Book (in Hungarian), Tankonyvkiado, Budapest, 1972.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000010, A049237, A007694, A007947, A003557, A023200, A003586, A001221, A033950, A235353 (subsequence), A068997 (subsequence).

Programs

  • Haskell
    a007694 n = a007694_list !! (n-1)
    a007694_list = 1 : filter even a003586_list
    -- Reinhard Zumkeller, Jan 06 2014
    
  • Maple
    select(n -> n mod numtheory:-phi(n) = 0, [$1..5000]); # Robert Israel, Nov 03 2014
  • Mathematica
    Select[ Range[5000], IntegerQ[ #/EulerPhi[ # ]] &]
    m = 5000; Join[{1}, Sort @ Flatten @ Table[2^i*3^j, {i, 1, Log2[m]}, {j, 0, Log[3, m/2^i]}]] (* Amiram Eldar, Oct 29 2020 *)
  • PARI
    for(n=1,10^6, if (n%eulerphi(n)==0,print1(n,", "))); \\ Joerg Arndt, Apr 04 2013
    
  • PARI
    list(lim)=my(v=List([1]),t); for(i=1,logint(lim\1,2), listput(v,t=2^i); for(j=1,logint(lim\t,3), listput(v,t*=3))); Set(v) \\ Charles R Greathouse IV, Nov 10 2015
    
  • R
    library(numbers); j=N=1
    while(j<200) if(isNatural((N=N+1)/eulersPhi(N))) dtot[(j=j+1)]=N # Christian N. K. Anderson, Apr 04 2013
    
  • Sage
    is_A007694 = lambda n: euler_phi(n).divides(n)
    A007694_list = lambda len: filter(is_A007694, (1..len))
    A007694_list(4100) # Peter Luschny, Oct 03 2014

Formula

k/phi(k) is an integer if and only if k = 1 or k = 2^w * 3^u for w > 0 and u >= 0.
k/phi(k) = 3 if and only if phi(k)|k and 3|k. - Thomas Ordowski, Nov 03 2014
a(n) is approximately exp(sqrt(2*log(2)*log(3)*n))/sqrt(3/2). - Charles R Greathouse IV, Nov 10 2015
From Amiram Eldar, Oct 29 2020: (Start)
a(n) = 2 * A003586(n) for n > 1.
Sum_{n>=1} 1/a(n) = 5/2. (End)

A029710 Primes such that next prime is 4 greater.

Original entry on oeis.org

7, 13, 19, 37, 43, 67, 79, 97, 103, 109, 127, 163, 193, 223, 229, 277, 307, 313, 349, 379, 397, 439, 457, 463, 487, 499, 613, 643, 673, 739, 757, 769, 823, 853, 859, 877, 883, 907, 937, 967, 1009, 1087, 1093, 1213, 1279, 1297, 1303, 1423, 1429
Offset: 1

Views

Author

Keywords

Comments

Union with A124588 gives A124589. - Reinhard Zumkeller, Dec 23 2006
For any prime p > 3, if p + 4 is prime then necessarily it is the next prime. But there cannot be three consecutive primes with mutual distance 4: If p and p + 4 are prime, then p+8 is an odd multiple of 3 (cf. formula). - M. F. Hasler, Jan 15 2013
The smaller members p of cousin prime pairs (p,p+4) excluding p=3. - Marc Morgenegg, Apr 19 2016

Examples

			79 is a term as the next prime is 79 + 4 = 83. 3 is not a term even though 3 + 4 = 7 is prime, since it is not the next one.
		

Crossrefs

Essentially the same as A023200.

Programs

  • MATLAB
    p=primes(1700);m=1;
    for u=1:length(p)-4
       if and(isprime(p(u)+4)==1,p(u+1)==p(u)+4);sol(m)=p(u);m=m+1;end
    end
    sol % Marius A. Burtea, Jan 24 2019
  • Magma
    [p:p in PrimesUpTo(1700)| IsPrime(p+4) and NextPrime(p) eq p+4] // Marius A. Burtea, Jan 24 2019
    
  • Maple
    for i from 1 to 226 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i)}); fi; od; # Zerinvary Lajos, Mar 19 2007
  • Mathematica
    Select[Prime[Range[225]], NextPrime[#] == # + 4 &] (* Alonso del Arte, Jan 17 2013 *)
    Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&]] [[1]] (* Harvey P. Dale, Mar 28 2016 *)
  • PARI
    forprime(p=1, 1e4, if(nextprime(p+1)-p==4, print1(p, ", "))) \\ Felix Fröhlich, Aug 16 2014
    

Formula

a(n) = A031505(n + 1) - 4 = A029708(n) - 2.
a(n) = 1 (mod 6) for all n; (a(n) + 2)/3 = A157834(n), i.e., a(n) = 3*A157834(n) - 2. - M. F. Hasler, Jan 15 2013

A029709 Numbers k such that k-th and (k+1)st primes differ by 4.

Original entry on oeis.org

4, 6, 8, 12, 14, 19, 22, 25, 27, 29, 31, 38, 44, 48, 50, 59, 63, 65, 70, 75, 78, 85, 88, 90, 93, 95, 112, 117, 122, 131, 134, 136, 143, 147, 149, 151, 153, 155, 159, 163, 169, 181, 183, 198, 207, 211, 213, 224, 226, 229, 235, 237, 244, 247, 249, 251
Offset: 1

Views

Author

Keywords

Comments

Positions of 4 in A001223. - Zak Seidov, Apr 28 2015

Crossrefs

Programs

  • Magma
    [n: n in [0..300] | NthPrime(n+1) - NthPrime(n) eq 4]; // Vincenzo Librandi, Apr 28 2015
  • Mathematica
    Select[Range[2, 300], 4 == (Prime[# + 1] - Prime[#]) &] (* Vincenzo Librandi, Apr 28 2015 *)

Formula

A029710(n) = prime(a(n)). - R. J. Mathar, Apr 30 2024

A060308 Largest prime <= 2n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 27 2001

Keywords

Comments

a(n) is the smallest k such that C(2n,n) divides k!. - Benoit Cloitre, May 30 2002
a(n) is largest prime factor of C(2n,n) = (2n)!/(n!)^2. - Alexander Adamchuk, Jul 11 2006
a(n) is also the largest prime in the interval [n,2n]. - Peter Luschny, Mar 04 2011
Odd prime p repeats (q-p)/2 times, where q > p is the next prime. In particular, every lesser of twin primes (A001359) occurs 1 time, every lesser more than 3 of cousin primes (A023200) occurs 2 times, etc. - Vladimir Shevelev, Mar 12 2012

Examples

			n=1, 2n=2, p(1) = 2 = a(1) is the largest prime not exceeding 2.
		

Crossrefs

Apart from initial term, same as A060265.
Cf. A007917 (largest prime <= n), A005843 (2n).

Programs

Formula

a(n) = Max[FactorInteger[(2n)!/(n!)^2]]. - Alexander Adamchuk, Jul 11 2006
a(n) = A006530(A000142(2*n)) and a(n) = A006530(A056040(2*n)). - Peter Luschny, Mar 04 2011
a(n) ~ 2*n as n tends to infinity. - Vladimir Shevelev, Mar 12 2012
a(n) = A007917(A005843(n)) = A226078(n, A067434(n)). - Reinhard Zumkeller, May 25 2013

Extensions

More terms from Alexander Adamchuk, Jul 11 2006
Showing 1-10 of 154 results. Next