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 21-30 of 2216 results. Next

A237284 Number of ordered ways to write 2*n = p + q with p, q and A000720(p) all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 06 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 6, 13, 16, 19, 28, 34, 40, 61, 166, 278.
This is stronger than Goldbach's conjecture.
The conjecture is true for n <= 5*10^8. - Dmitry Kamenetsky, Mar 13 2020

Examples

			a(13) = 1 since 2*13 = 3 + 23 with 3, 23 and A000720(3) = 2 all prime.
a(278) = 1 since 2*278 = 509 + 47 with 509, 47 and A000720(509) = 97 all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[2n-Prime[Prime[k]]],1,0],{k,1,PrimePi[PrimePi[2n-1]]}]
    Table[a[n],{n,1,80}]

A291440 a(n) = pi(n^2) - pi(n)^2, where pi(n) = A000720(n).

Original entry on oeis.org

0, 1, 0, 2, 0, 2, -1, 2, 6, 9, 5, 9, 3, 8, 12, 18, 12, 17, 8, 14, 21, 28, 18, 24, 33, 41, 48, 56, 46, 54, 41, 51, 60, 70, 79, 89, 75, 84, 96, 107, 94, 105, 87, 99, 110, 123, 104, 117, 132, 142, 153, 168, 153, 165, 178, 189, 201, 218, 198, 214, 195, 208, 225, 240, 254, 270, 248, 263, 280, 293, 275, 290, 264, 281, 298, 316, 338, 352, 327, 350
Offset: 1

Views

Author

Jonathan Sondow, Aug 23 2017

Keywords

Comments

The only zero values are a(1) = a(3) = a(5) = 0. The only negative value is a(7) = -1. In particular, pi(n^2) > pi(n)^2 for n > 7. These can be proved by the PNT with error term for large n and computation for smaller n.
For prime(n)^2 - prime(n^2), see A123914.
For pi(n^3) - pi(n)^3, see A291538.
Mincu and Panaitopol (2008) prove that pi(m*n) >= pi(m)*pi(n) for all positive m and n except for m = 5, n = 7; m = 7, n = 5; and m = n = 7. This implies for m = n that a(n) >= 0 if n <> 7. - Jonathan Sondow, Nov 03 2017
Diagonal of the triangular array A294508. - Jonathan Sondow and Robert G. Wilson v, Nov 08 2017

Examples

			a(7) = pi(7^2) - pi(7)^2 = 15 - 4^2 = -1.
		

Crossrefs

Programs

  • Magma
    [#PrimesUpTo(n^2)-#PrimesUpTo(n)^2: n in [1..80]]; // Vincenzo Librandi, Aug 26 2017
    
  • Maple
    seq(numtheory:-pi(n^2)-numtheory:-pi(n)^2, n=1..100); # Robert Israel, Aug 25 2017
  • Mathematica
    Table[PrimePi[n^2] - PrimePi[n]^2, {n, 80}]
  • PARI
    a(n) = primepi(n^2) - primepi(n)^2; \\ Michel Marcus, Sep 10 2017

Formula

a(n) = A000720(n^2) - A000720(n)^2.
a(n) ~ (n^2 / log(n))*(1/2 - 1/log(n)) as n tends to infinity, by the PNT.
From Jonathan Sondow and Robert G. Wilson v, Nov 08 2017: (Start)
a(n) = A294508(n*(n+1)/2).
a(n) >= A294509(n). (End)

A332808 Fully multiplicative with a(p) = A332806(A000720(p)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 19, 20, 21, 26, 29, 24, 25, 22, 27, 28, 23, 30, 37, 32, 39, 34, 35, 36, 31, 38, 33, 40, 41, 42, 43, 52, 45, 58, 53, 48, 49, 50, 51, 44, 47, 54, 65, 56, 57, 46, 61, 60, 59, 74, 63, 64, 55, 78, 71, 68, 87, 70, 79, 72, 67, 62, 75, 76, 91, 66, 89, 80, 81, 82, 101
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Cf. A000720, A332806, A108549 (fixed points), A332818, A332819.
Inverse permutation is A108548, from which this differs for the first time at n=67, where a(67) = 71, while A108548(67) = 73.

Programs

  • PARI
    up_to = 10000;
    A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p,q,u); v[2] = 3; v[1] = 5; mapput(xs,1,1); mapput(xs,2,2); mapput(xs,3,3);  for(n=4,up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs,primepi(q),n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
    v332806 = A332806list(up_to);
    A332806(n) = v332806[n];
    A332808(n) = { my(f=factor(n)); f[,1] = apply(A332806,apply(primepi,f[,1])); factorback(f); };

A365400 a(n) = 64 + A000720(n) - A365339(n).

Original entry on oeis.org

63, 63, 63, 62, 62, 62, 62, 62, 61, 61, 61, 61, 61, 61, 60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 58, 58, 58, 58, 58, 58, 58, 58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 56
Offset: 1

Views

Author

Peter Luschny, Sep 06 2023

Keywords

Comments

It is conjectured that A365339(n) = PrimePi(n) + 64 for all n >= 31957 (Pollack et al.). Assuming this conjecture a(n) = 0 for n > 31956.
a is not monotonically decreasing.

Crossrefs

Programs

  • Julia
    # Computes the first N terms of the sequence.
    using Nemo
    function A365400List(N)
        phi = Int64[i for i in 1:N + 1]
        for i in 2:N + 1
            if phi[i] == i
                for j in i:i:N + 1
                    phi[j] -= div(phi[j], i)
        end end end
        lst = zeros(Int64, N)
        dyn = zeros(Int64, N)
        pi = 64
        for n in 1:N
            p = phi[n]
            nxt = dyn[p] + 1
            while p <= N && dyn[p] < nxt
                dyn[p] = nxt
                p += 1
            end
            pi += is_prime(n) ? 1 : 0
            lst[n] = pi - dyn[n]
        end
        return lst
    end
    println(A365400List(32000))
    
  • Python
    from bisect import bisect
    from sympy import totient, primepi
    def A365400(n):
        plist, qlist, c = tuple(totient(i) for i in range(1,n+1)), [0]*(n+1), 0
        for i in range(n):
            qlist[a:=bisect(qlist,plist[i],lo=1,hi=c+1,key=lambda x:plist[x])]=i
            c = max(c,a)
        return 64+primepi(n)-c # Chai Wah Wu, Sep 06 2023

A212210 Triangle read by rows: T(n,k) = pi(n) + pi(k) - pi(n+k), n >= 1, 1 <= k <= n, where pi() = A000720().

Original entry on oeis.org

-1, -1, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, 1, 2, -1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 2, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 0, 0, 1, 0, 1, 1, 2, 1, 1, -1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, -1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 3, 3
Offset: 1

Views

Author

N. J. A. Sloane, May 04 2012

Keywords

Comments

It is conjectured that pi(x)+pi(y) >= pi(x+y) for 1 < y <= x.
A006093 gives row numbers of rows containing at least one negative term. [Reinhard Zumkeller, May 05 2012]

Examples

			Triangle begins:
  -1
  -1 0
   0 0 1
  -1 0 0 0
   0 0 1 1 2
  -1 0 1 1 1 1
   0 1 2 1 2 1 2
   0 1 1 1 1 1 2 2
   0 0 1 0 1 1 2 1 1
  -1 0 0 0 1 1 1 1 0 0
  ...
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a212210 n k = a212210_tabl !! (n-1) !! (k-1)
    a212210_row n = a212210_tabl !! (n-1)
    a212210_tabl = f $ tail $ zip (inits pis) (tails pis) where
       f ((xs,ys) : zss) = (zipWith (-) (map (+ last xs) (xs)) ys) : f zss
       pis = a000720_list
    -- Reinhard Zumkeller, May 04 2012
  • Mathematica
    t[n_, k_] := PrimePi[n] + PrimePi[k] - PrimePi[n + k]; Table[t[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Oct 17 2012 *)

A214935 Index of the primes of A205827, A000720(A205827(n)).

Original entry on oeis.org

1, 2, 4, 9, 30, 189, 217, 2225, 3385, 14357, 30802, 31545, 104071, 149689, 1094421, 1319945, 10655462, 23163298, 112228683, 182837804, 203615628, 486570087, 1094330259, 11992433550, 17883926781, 50070452577, 52302956123, 72178455400
Offset: 1

Views

Author

John W. Nicholson, Oct 28 2012

Keywords

Comments

A000040(a(n)) = A205827(n).
With pi(x) being the prime counting function, A000720(x), for n from 1 to 3, a(n) = pi(A111870(n)) = A241542(n), for n from 5 to 28, a(n) = pi(A111870(n-1)) = A241542(n-1). - John W. Nicholson, May 10 2014

Examples

			a(4) = 9, A000040(9) = 23, and A205827(4) = 23.
		

Crossrefs

Cf. A205827.

Programs

Formula

a(n) = pi(A205827(n)) = A000720(A205827(n)).

Extensions

a(13)-a(28) from Donovan Johnson, Oct 28 2012
a(29)-a(38) from John W. Nicholson, Dec 01 2013

A237612 Least positive integer k such that A000720(k*n) is a square, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 1, 3, 2, 2, 4, 1, 1, 1, 1, 5, 2, 2, 2, 28, 34, 9, 3, 3, 5, 20, 7, 1, 1, 1, 1, 1, 1, 2, 14, 5, 17, 3, 16, 12, 23, 18, 4, 4, 30, 46, 10, 50, 23, 36, 18, 40, 14, 2, 2, 3, 3, 1, 1, 1, 1, 1, 1, 32, 7, 11, 68, 19, 79, 29, 267, 10, 8, 12, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

According to the conjecture in A237598, we should always have 0 < a(n) < prime(n).

Examples

			a(3) = 3 since A000720(3*3) = 4 is a square, but neither A000720(1*3) = 2  nor A000720(2*3) = 3 is a square.
		

Crossrefs

Programs

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

A354202 Fully multiplicative with a(p^e) = A354200(A000720(p))^e.

Original entry on oeis.org

1, 5, 7, 25, 13, 35, 11, 125, 49, 65, 19, 175, 17, 55, 91, 625, 29, 245, 23, 325, 77, 95, 31, 875, 169, 85, 343, 275, 37, 455, 43, 3125, 133, 145, 143, 1225, 41, 115, 119, 1625, 53, 385, 47, 475, 637, 155, 59, 4375, 121, 845, 203, 425, 61, 1715, 247, 1375, 161, 185, 67, 2275, 73, 215, 539, 15625, 221, 665, 71, 725
Offset: 1

Views

Author

Antti Karttunen, May 23 2022

Keywords

Comments

Permutation of A007310. Preserves the prime signature.

Crossrefs

Cf. A007310 (terms sorted into ascending order), A354200, A354203 (left inverse), A354204 (Möbius transform), A354205 (inverse Möbius transform).
Cf. also A003961, A108548, A267099, A332818, A348746, A354091 for similar constructions.

Programs

  • PARI
    A354200(n) = if(1==n,5,my(p=prime(n), m=p%4); forprime(q=1+p,,if(m==(q%4),return(q))));
    A354202(n) = { my(f=factor(n)); for(k=1,#f~,f[k,1] = A354200(primepi(f[k,1]))); factorback(f); };

A038626 Smallest positive integer m such that m = pi(n*m) = A000720(n*m).

Original entry on oeis.org

1, 9, 24, 66, 168, 437, 1051, 2614, 6454, 15927, 40071, 100346, 251706, 637197, 1617172, 4124436, 10553399, 27066969, 69709679, 179992838, 465769802, 1208198523, 3140421715, 8179002095, 21338685402, 55762149023, 145935689357, 382465573481, 1003652347080, 2636913002890, 6935812012540
Offset: 2

Views

Author

Keywords

Comments

Golomb shows that solutions exist for each n>1.
For all known terms, we have 2.4*a(n) < a(n+1) < 2.7*a(n) + 7. A038627(n) gives number of natural solutions of the equation m = pi(n*m). - Farideh Firoozbakht, Jan 09 2005
a(n) grows as exp(n)/n. Thus, a(n+1)/a(n) tends to e=exp(1) as n grows. - Max Alekseyev, Oct 15 2017

Examples

			pi(3059) = 437 and 3059/437 = 7, so a(7)=437.
		

Crossrefs

Formula

a(n) = limit of f^(k)(1) as k grows, where f(x)=A000720(n*x). Also, a(n) = f^(A293529(n))(1). - Max Alekseyev, Oct 11 2017
a(n) = A038625(n) / n. - Max Alekseyev, Oct 13 2023

Extensions

a(24) from Farideh Firoozbakht, Jan 09 2005
Edited by N. J. A. Sloane at the suggestion of Chris K. Caldwell, Apr 08 2008
a(25)-a(32) from Max Alekseyev, Jul 18 2011, Oct 14 2017
a(33)-a(50) obtained from the values of A038625 computed by Jan Büthe. - Giovanni Resta, Aug 31 2018

A212213 Array read by antidiagonals: pi(n) + pi(k) - pi(n+k), where pi() = A000720.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
Offset: 2

Views

Author

N. J. A. Sloane, May 04 2012

Keywords

Comments

It is conjectured that pi(x) + pi(y) >= pi(x+y) for 1 < y <= x.

Examples

			Array begins:
  0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, ...
  0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, ...
  0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, ...
  0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, ...
  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, ...
  1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, ...
  ...
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.

Crossrefs

Programs

  • Mathematica
    t[n_, k_] := PrimePi[n] + PrimePi[k] - PrimePi[n + k]; Table[t[n - k + 2, k], {n, 0, 15}, {k, 2, n}] // Flatten (* Jean-François Alcover, Dec 31 2012 *)
Previous Showing 21-30 of 2216 results. Next