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

A237879 Least positive integer k <= n such that the number of twin prime pairs not exceeding k*n is a square, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 15, 14, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 17, 7, 7, 3, 3, 15, 14, 6, 6, 13, 13, 13, 12, 12, 5, 5, 5, 11, 11, 11, 2, 2, 2, 10, 10, 10, 4, 4, 4, 9, 9, 9, 16, 46, 8, 8, 8, 8, 8, 8, 65, 14, 52, 7, 7, 3, 3, 3, 3
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 14 2014

Keywords

Comments

According to the conjecture in A237840, a(n) should be always positive.

Examples

			a(7) = 3 since there are exactly 2^2 = 4 twin prime pairs not exceeding 3*7 = 21 (namely, {3, 5}, {5, 7}, {11, 13} and {17, 19}), but the number of twin prime pairs not exceeding 1*7 and the number of twin prime pairs not exceeding 2*7 are 2 and 3 respectively, none of which is a square.
		

Crossrefs

Programs

  • Mathematica
    tw[0]:=0
    tw[n_]:=tw[n-1]+If[PrimeQ[Prime[n]+2],1,0]
    SQ[n_]:=IntegerQ[Sqrt[tw[PrimePi[n]]]]
    Do[Do[If[SQ[k*n-2],Print[n," ",k];Goto[aa]],{k,1,n}];
    Print[n," ",0];Label[aa];Continue,{n,1,100}]

A238902 a(n) = |{0 < k <= n: pi(pi(k*n)) is a square}|, where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 06 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0.
(ii) For every n = 1, 2, 3, ..., there exists a positive integer k <= (n+1)/2 such that pi(pi(k*n)) is a triangular number.
We have verified parts (i) and (ii) for n up to 2*10^5 and 10^5 respectively.
See A239884 for a sequence related to part (i) of the conjecture.

Examples

			a(8)    = 1 since pi(pi(3*8)) = pi(pi(24)) = pi(9) = 2^2.
a(434)  = 1 since pi(pi(297*434)) = pi(pi(128898)) = pi(12064) = 38^2.
a(1042) = 1 since pi(pi(698*1042)) = pi(pi(727316)) = pi(58590) = 77^2.
a(9143) = 1 since pi(pi(8514*9143)) = pi(pi(77843502)) = pi(4550901) = 565^2.
a(48044)  > 0 since pi(pi(18332*48044))  = pi(45075237)  = 1650^2.
a(52158)  > 0 since pi(pi(27976*52158))  = pi(72792062)  = 2067^2.
a(78563)  > 0 since pi(pi(26031*78563))  = pi(100326489) = 2404^2.
a(98213)  > 0 since pi(pi(37308*98213))  = pi(174740922) = 3123^2.
 a(141589) > 0 since pi(pi(42375*141589)) = pi(279538049)= 3899^2.
a(154473) > 0 since pi(pi(42954*154473)) = pi(307695484) = 4080^2.
a(195387) > 0 since pi(pi(60161*195387)) = pi(530982180) = 5282^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    p[k_,n_]:=SQ[PrimePi[PrimePi[k*n]]]
    a[n_]:=Sum[If[p[k,n],1,0],{k,1,n}]
    Table[a[n],{n,1,80}]
  • PARI
    {a(n) = sum( k=1, n, issquare( primepi( primepi( k*n))))}; /* Michael Somos, Mar 10 2014 */

A237975 Least nonnegative integer m such that for some k = 1, ..., n there are exactly m^2 twin prime pairs not exceeding k*n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 4, 4, 3, 3, 5, 5, 4, 4, 5, 5, 5, 5, 5, 4, 4, 4, 5, 5, 5, 3, 3, 3, 5, 5, 5, 4, 4, 4, 5, 5, 5, 6, 9, 5, 5, 5, 5, 5, 5, 11, 6, 10, 5, 5, 4, 4, 4, 4, 5, 11, 9, 8, 9, 6, 10, 5, 5, 5, 5, 5, 5, 5, 5, 8, 11, 11, 7, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 16 2014

Keywords

Comments

The conjecture in A237840 implies that a(n) exists for any n > 0.

Examples

			a(7) = 2 since there are exactly 2^2 twin prime pairs not exceeding 3*7  = 21 (namely, {3, 5}, {5, 7}, {11, 13} and{17,19}), and the number of twin prime pairs not exceeding 1*7 or 2*7 is not a square.
a(18055) = 675 since there are exactly 675^2 = 455625 twin prime pairs not exceeding 5758*18055.
		

Crossrefs

Programs

  • Mathematica
    tw[0]:=0
    tw[n_]:=tw[n-1]+If[PrimeQ[Prime[n]+2],1,0]
    SQ[n_]:=IntegerQ[Sqrt[tw[PrimePi[n]]]]
    Do[Do[If[SQ[k*n-2],Print[n," ",Sqrt[tw[PrimePi[k*n-2]]]];Goto[aa]],{k,1,n}];Print[n," ",0];Label[aa];Continue,{n,1,100}]

A344117 Number of twin prime pairs in the range (6*n + 1, 6*(n + m) + 1], where m is the number of twin prime pairs, 6*k +- 1 for k = 1, 2, ..., n.

Original entry on oeis.org

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

Views

Author

Ya-Ping Lu, Jun 24 2021

Keywords

Comments

Conjecture: a(n) >= 1.

Crossrefs

Programs

  • Python
    from sympy import isprime
    def istwin(m): return 1 if isprime(6*m-1)*isprime(6*m+1) == 1 else 0
    ct1 = 0
    for n in range(1, 100):
        ct1 += istwin(n); ct = 0
        for m in range (n + 1, n + ct1 + 1): ct += istwin(m)
        print(ct)
Showing 1-4 of 4 results.