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 41-50 of 2219 results. Next

A259789 Least integer k > 1 such that pi(k)*pi(k*n) is a square, where pi(.) is the prime-counting function given by A000720.

Original entry on oeis.org

2, 27, 8, 2, 2, 9, 3, 5, 96, 10, 9, 2, 2, 2, 28, 4, 9, 11, 8, 195, 3, 3, 723, 28, 573, 225, 2, 2, 2, 35, 46, 132, 4, 4, 65, 14, 58, 11, 8, 967, 311, 10, 98, 3, 3, 21, 94, 20, 2, 2, 28, 23, 30, 16, 29, 3419, 134, 4, 251, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Jul 05 2015

Keywords

Comments

Conjecture: a(n) exists for any n > 0. In general, every positive rational number r can be written as m/n, where m and n are positive integers with pi(m)*pi(n) a positive square.
For example, 25/32 = 13102500/16771200 with pi(13102500)*pi(16771200) = 855432*1077512 = 921738245184 = 960072^2, and 49/58 = 1076068567/1273713814 with pi(1076068567)*pi(1273713814) = 54511776*63975626 = 3487424993971776 = 59054424^2.

Examples

			a(1) = 2 since pi(2)*pi(2*1) = 1^2.
a(2) = 27 since pi(27)*pi(27*2) = 9*16 = 12^2.
a(8) = 5 since pi(5)*pi(5*8) = 3*12 = 6^2.
a(9) = 96 since pi(96)*pi(96*9) = 24*150 = 60^2.
a(675) = 1465650 since pi(1465650)*pi(1465650*675) = 111747*50331648 = 5624410669056 = 2371584^2.
a(946) = 1922745 since pi(1922745)*pi(1922745*946) = 143599*89749375 = 12887920500625 = 3589975^2.
		

References

  • Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28 - Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    Do[k=1; Label[bb]; k=k+1; If[SQ[PrimePi[k]*PrimePi[k*n]], Goto[aa], Goto[bb]]; Label[aa]; Print[n, " ", k]; Continue,{n,1,60}]
    liks[n_]:=Module[{k=2},While[!IntegerQ[Sqrt[PrimePi[k]PrimePi[k*n]]],k++];k]; Array[liks,60] (* Harvey P. Dale, Jul 12 2024 *)
  • PARI
    main(size) = {v=vector(size);for(t=1,size,v[t]=1;until(issquare(primepi(v[t])*primepi(t*v[t])),v[t]++));return(v);} \\ Anders Hellström, Jul 05 2015

A291538 a(n) = PrimePi(n^3) - PrimePi(n)^3, where PrimePi = A000720.

Original entry on oeis.org

0, 3, 1, 10, 3, 20, 4, 33, 65, 104, 92, 144, 111, 184, 260, 348, 313, 422, 370, 495, 635, 786, 728, 904, 1092, 1291, 1498, 1731, 1707, 1961, 1897, 2181, 2486, 2806, 3152, 3490, 3466, 3851, 4267, 4685, 4653, 5111, 5045, 5549, 6066, 6617, 6541, 7124, 7723, 8359, 9007, 9685, 9650, 10383, 11106, 11859, 12669, 13487, 13498, 14374
Offset: 1

Views

Author

Jonathan Sondow, following a suggestion from Altug Alkan, Aug 25 2017

Keywords

Comments

All terms are positive except a(1) = 0, by the PNT with error term for large n and computation for smaller n. In particular, PrimePi(n^3) > PrimePi(n)^3 for n > 1. Indeed, by A291539 and A291540, PrimePi(n^3) > PrimePi(n) * PrimePi(n^2) > PrimePi(n)^3 for n > 7.
For prime(n)^3 - prime(n^3), see A262199.
For PrimePi(n^2) - PrimePi(n)^2, see A291440.

Examples

			a(3) = PrimePi(3^3) - PrimePi(3)^3 = 9 - 2^3 = 1.
		

Crossrefs

Programs

  • Mathematica
    Table[ PrimePi[n^3] - PrimePi[n]^3, {n, 60}]
  • PARI
    a(n) = primepi(n^3) - primepi(n)^3; \\ Michel Marcus, Sep 10 2017

Formula

a(n) = A000720(n^3) - A000720(n)^3.
a(n) = A291539(n) + A291540(n).
a(n) ~ (n^3 / log(n))*(1/3 - 1/log(n)^2) as n tends to infinity.

A332422 If n = Product (p_j^k_j) then a(n) = Sum ((-1)^(pi(p_j) + 1) * pi(p_j)), where pi = A000720.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 12 2020

Keywords

Comments

Sum of odd indices of distinct prime factors of n minus the sum of even indices of distinct prime factors of n.

Examples

			a(66) = a(2 * 3 * 11) = a(prime(1) * prime(2) * prime(5)) = 1 - 2 + 5 = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Plus @@ ((-1)^(PrimePi[#[[1]]] + 1) PrimePi[#[[1]]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 72}]
    nmax = 72; CoefficientList[Series[Sum[(-1)^(k + 1) k x^Prime[k]/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest

Formula

G.f.: Sum_{k>=1} (-1)^(k + 1) * k * x^prime(k) / (1 - x^prime(k)).

A335294 a(n) = pi(n) - pi(Sum_{k=1..n-1} a(k)) with a(1) = 1, where pi() is the prime counting function A000720.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jun 01 2020

Keywords

Comments

Alkan, Booker, & Luca prove that every nonnegative integer appears infinitely often.

Crossrefs

Cf. A000720, A335337 (when k appears), A334714 (partial sums).

Programs

  • Maple
    A[1]:= 1: S:= 1:
    for n from 2 to 100 do
      A[n]:= numtheory:-pi(n) - numtheory:-pi(S);
      S:= S + A[n];
    od:
    seq(A[n],n=1..100); # Robert Israel, Jun 01 2020
  • Mathematica
    a[1] = 1; a[n_] := a[n] = PrimePi[n] - PrimePi[Sum[a[k], {k, 1, n-1}]]; Array[a, 100] (* Amiram Eldar, Jun 01 2020 *)
    upto[nn_] := Reap[Block[{i=0, is=0, sp=2, p=2, s=1}, Sow@ 1; Do[ If[n == p, i++; p = NextPrime@ p]; Sow[i - is]; s += i - is; While[ s >= sp, is++; sp = NextPrime@ sp], {n, 2, nn}]]] [[2, 1]]; upto[97] (* Giovanni Resta, Jun 02 2020 *)
  • PARI
    a=vector(10^2); a[1] = 1; for(n=2, #a, a[n] = primepi(n) - primepi(sum(k=1, n-1, a[k]))); a
    
  • PARI
    first(n) = {my(res = vector(n), pp = 0, s = 1, ps=0); primepivec = vector(n); forprime(p = 2, n, primepivec[p] = 1; ); for(i = 2, n, primepivec[i] += primepivec[i-1] ); res[1] = 1; for(i = 2, n, if(isprime(i), pp++); res[i] = pp - ps; s+=(pp-ps); ps = primepivec[s]; ); res } \\ David A. Corneth, Jun 01 2020
    
  • Python
    from sympy import primepi
    A = [1]
    S = 1
    for n in range(1, 101):
        A += [primepi(n+1) - primepi(S), ]
        S += A[n]
    print(A) # Indranil Ghosh, Jun 21 2020, after Maple

A073798 pi(n) is a power of 2, where pi(n) = A000720(n) is the number of primes <= n.

Original entry on oeis.org

2, 3, 4, 7, 8, 9, 10, 19, 20, 21, 22, 53, 54, 55, 56, 57, 58, 131, 132, 133, 134, 135, 136, 311, 312, 719, 720, 721, 722, 723, 724, 725, 726, 1619, 1620, 3671, 3672, 8161, 8162, 8163, 8164, 8165, 8166, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870
Offset: 1

Views

Author

Labos Elemer, Aug 14 2002

Keywords

Comments

The numbers occur in blocks of consecutive integers: 2, 3-4, 7-10, 19-22, ...; the n-th block starts at the 2^n-th prime (A033844) and ends just before the (2^n + 1)-th prime (A051439).

Examples

			10 is in the sequence since pi(10)=4=2^2.
		

Crossrefs

Programs

  • Mathematica
    pow2[n_] := n==1||(n>1&&IntegerQ[n/2]&&pow2[n/2]); Select[Range[20000], pow2[PrimePi[ # ]]&]
    Flatten@Table[Range[p = Prime[2^k], NextPrime[p] - 1], {k, 0, 11}] (* Ivan Neretin, Jan 21 2017 *)
  • PARI
    isok(n) = my(pi = primepi(n)); (pi==1) || (pi==2) || (ispower(primepi(n),,&k) && (k==2)); \\ Michel Marcus, Jan 23 2017

Extensions

Edited by Dean Hickerson, Aug 15 2002

A132090 a(n) = pi(pi(n)), where pi = A000720.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Sep 03 2007

Keywords

Comments

a(n) = a(n-1) + 1 if n is in A006450, otherwise a(n) = a(n-1). - Robert Israel, Jan 20 2016

Crossrefs

Programs

Formula

a(n) ~ n/log^2 n. - Charles R Greathouse IV, Aug 12 2014

A237496 Number of ordered ways to write n = k + m (0 < k <= m) with pi(k) + pi(m) - 2 prime, where pi(.) is given by A000720.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 08 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5.
(ii) Any integer n > 23 can be written as k + m (k > 0 and m > 0) with pi(k) + pi(m) prime. Also, each integer n > 25 can be written as k + m (k > 0 and m > 0) with pi(k) + pi(m) - 1 prime.

Examples

			a(6) = 1 since 6 = 3 + 3 with pi(3) + pi(3) - 2 = 2 + 2 - 2 = 2 prime.
a(17) = 1 since 17 = 2 + 15 with pi(2) + pi(15) - 2 = 1 + 6 - 2 = 5 prime.
a(99) = 1 since 99 = 1 + 98 with pi(1) + pi(98) - 2 = 0 + 25 - 2 = 23 prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>0&&PrimeQ[n]
    p[k_,m_]:=PQ[PrimePi[k]+PrimePi[m]-2]
    a[n_]:=Sum[If[p[k,n-k],1,0],{k,1,n/2}]
    Table[a[n],{n,1,80}]

A237614 Least positive integer k with A000720(k*n) divisible by n, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 2, 2, 2, 6, 11, 11, 7, 3, 3, 3, 8, 13, 13, 8, 14, 14, 14, 33, 33, 9, 15, 9, 4, 4, 42, 22, 22, 43, 4, 36, 99, 10, 10, 10, 10, 38, 38, 38, 38, 31, 24, 17, 17, 17, 62, 24, 194, 55, 80, 11, 40, 11, 11, 11, 11, 11, 57, 11, 11, 33, 18, 18, 83, 164, 5, 5, 5, 156, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

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

Examples

			a(3) = 2 since pi(2*3) = 3 is divisible by 3, but pi(1*3) = 2 is not.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[Mod[PrimePi[k*n],n]==0,Print[n," ",k];Goto[aa]],{k,1,Prime[n]-1}];
    Print[n," ",0];Label[aa];Continue,{n,1,70}]

A237656 Least positive integer m such that {A000720(k^2): k = 1, ..., m} contains a complete system of residues modulo n, or 0 if such a number m does not exist.

Original entry on oeis.org

1, 5, 3, 6, 8, 10, 18, 17, 30, 41, 28, 43, 29, 33, 43, 27, 66, 47, 98, 105, 155, 114, 113, 100, 49, 62, 118, 146, 85, 125, 80, 117, 74, 101, 167, 137, 168, 282, 176, 287, 129, 178, 151, 140, 163, 139, 262, 267, 277, 234, 285, 188, 203, 163, 192, 239, 188, 241, 252, 252
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 10 2014

Keywords

Comments

Conjecture: a(n) is always positive. Moreover, a(n) < 2*prime(n+1) - 2 for all n > 0.
Note that a(21) = 155 = 2*prime(22) - 3.

Examples

			a(5) = 8 since {A000720(k^2): k = 1, ..., 8} = {0, 2, 4, 6, 9, 11, 15, 18} contains a complete system of residues modulo 5, but {A000720(k^2): k = 1, ..., 7} contains no integer congruent to 3 modulo 5.
		

Crossrefs

Programs

  • Mathematica
    q[m_,n_]:=Length[Union[Table[Mod[PrimePi[k^2],n],{k,1,m}]]]
    Do[Do[If[q[m,n]==n,Print[n," ",m];Goto[aa]],{m,n,2*Prime[n+1]-3}];
    Print[n," ",0];Label[aa];Continue,{n,1,60}]

A249809 Irregular table read by rows: T(n, k) is the number of times prime p_k has occurred as the smallest prime factor of numbers 1 .. n. (T(1,1) = 0, and for each n > 1, k = 1 .. A000720(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

After the first row {0}, consists of rows of triangular table A249808 with trailing zeros removed.

Examples

			Table begins:
       k=1  2  3  4  5  6  7
  n=1:   0;
  n=2:   1;
  n=3:   1, 1;
  n=4:   2, 1;
  n=5:   2, 1, 1;
  n=6:   3, 1, 1;
  n=7:   3, 1, 1, 1;
  n=8:   4, 1, 1, 1;
  n=9:   4, 2, 1, 1;
  n=10:  5, 2, 1, 1;
  n=11:  5, 2, 1, 1, 1;
  n=12:  6, 2, 1, 1, 1;
  n=13:  6, 2, 1, 1, 1, 1;
  n=14:  7, 2, 1, 1, 1, 1;
  n=15:  7, 3, 1, 1, 1, 1;
  n=16:  8, 3, 1, 1, 1, 1;
  n=17:  8, 3, 1, 1, 1, 1, 1;
  ...
		

Crossrefs

A004526 gives the left edge, A001477 the row sums.

Programs

Formula

a(n) = A249808(A249728(n), A249727(n)).
For n > 1, A078898(n) = T(n, A055396(n)).
Previous Showing 41-50 of 2219 results. Next