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 11-20 of 67 results. Next

A060208 a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Rosser & Schoenfeld show 2*pi(x) > pi(2*x) for x > 10. - N. J. A. Sloane, Jul 03 2013, corrected Jul 09 2015

Examples

			n=100, pi(100)=25, pi(200)=46, 2pi(100)-pi(2*100) =4=a(100)
		

References

  • J. Barkley Rosser and Lowell Schoenfeld, Abstracts of Scientific Communications, Internat. Congress Math., Moscow, 1966, Section 3, Theory of Numbers.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.
  • Sanford Segal, On Pi(x+y)<=Pi(x)+Pi(y). Transactions American Mathematical Society, 104 (1962), 523-527.

Crossrefs

Programs

  • Magma
    [2*#PrimesUpTo(n) -#PrimesUpTo(2*n): n in [1..200]]; // G. C. Greubel, Aug 01 2024
    
  • Mathematica
    f[n_] := 2 PrimePi[n] - PrimePi[2 n]; Array[f, 122] (* Robert G. Wilson v, Aug 12 2011 *)
  • PARI
    a(n)=2*primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, Jul 02 2013
    
  • SageMath
    [2*prime_pi(n) -prime_pi(2*n) for n in range(1,201)] # G. C. Greubel, Aug 01 2024

Formula

a(n) = Mod[2*PrimePi[n], PrimePi[2n]] = 2*A000720(n) - A000720(2n) for n>1.
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
a(n) = -A047886(n,n) (see A212210 to A212213). - Reinhard Zumkeller, Apr 15 2008

Extensions

Edited by N. J. A. Sloane, Jul 03 2013

A099825 Sum of the first 2^n primes.

Original entry on oeis.org

2, 5, 17, 77, 381, 1851, 8893, 41741, 191755, 868151, 3875933, 17120309, 74950547, 325590115, 1405167561, 6029676711, 25750781177, 109495928099, 463852117169, 1958476902435, 8244703036797, 34615624751259, 144991244981985, 605994279458465, 2527803622205465
Offset: 0

Views

Author

Robert G. Wilson v, Oct 25 2004

Keywords

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[0] = 2; f[n_] := f[n] = Block[{k = 0, mx = 2^n/2, np = Prime[2^n/2], s = f[n - 1]}, While[k < mx, k++; np = NextPrim@np; s = s + np]; s]; Table[ f@n, {n, 0, 23}] (* Robert G. Wilson v, Aug 24 2006 *)
    Module[{nn=22,ap},ap=Accumulate[Prime[Range[2^nn]]];Table[ap[[2^n]],{n,0,nn}]] (* Harvey P. Dale, Apr 12 2017 *)
  • PARI
    a(n)=my(s); n=2^n; forprime(p=2,, s+=p; if(n--==0, return(s))) \\ Charles R Greathouse IV, Feb 16 2017 \\ corrected by David A. Corneth, Aug 05 2025

Formula

a(n) = A007504(A000079(n)). - Amiram Eldar, Jul 01 2024

A082862 Prime(2^j) where j are the positions at which (prime(2^k+1)-prime(2^k))/log(prime(2^k)) set low-value records.

Original entry on oeis.org

2, 19, 131, 311, 1619, 3671, 1742537, 148948139, 2777105129, 16149760533341, 10082409897709157
Offset: 1

Views

Author

Labos Elemer, Apr 14 2003

Keywords

Comments

Similar to but not identical to A074327.

Examples

			The values of quotients at primes of this sequence are as follows: 1.442695..., 1.358493..., 1.230719..., 0.348444..., 0.270651..., 0.243658..., 0.139170..., 0.106274..., 0.091976..., 0.065761..., 0.054274... .
		

Crossrefs

Programs

  • Mathematica
    q=4; Do[s=(Prime[2^n+1]-Prime[2^n])/Log[Prime[2^n]]//N; If[sAmiram Eldar, Aug 10 2024 *)

Extensions

Data corrected and extended by Amiram Eldar, Aug 10 2024

A051438 a(n) = prime(2^n - 1).

Original entry on oeis.org

2, 5, 17, 47, 127, 307, 709, 1613, 3659, 8147, 17851, 38867, 84011, 180497, 386083, 821603, 1742527, 3681113, 7754017, 16290041, 34136021, 71378551, 148948133, 310248233, 645155191, 1339484149, 2777105117, 5750079043, 11891268397, 24563311217, 50685770143
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = A181363(2^n - 1). - Reinhard Zumkeller, Oct 16 2010
a(n) = A000040(A000225(n)). - Michel Marcus, Nov 28 2017
a(n) = A151799(A033844(n)). - Amiram Eldar, Jun 30 2024

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

A062439 Primes at large indices: a(n) = prime(n!).

Original entry on oeis.org

2, 2, 3, 13, 89, 659, 5443, 49033, 484037, 5222429, 61194647, 774825383, 10552185239, 153903050137, 2394322471421, 39588599419319, 693389445083107, 12826386978604427, 249902442548157673, 5115640857307591139, 109776797549312197217, 2464348772728229970857
Offset: 0

Views

Author

Labos Elemer, Jul 09 2001

Keywords

Crossrefs

Programs

  • Magma
    [(NthPrime(Factorial(n))): n in [0..11]]; // Vincenzo Librandi, Dec 07 2018
    
  • Maple
    seq(ithprime(factorial(n)),n=0..10); # Muniru A Asiru, Dec 07 2018
  • Mathematica
    Array[Prime[#!] &, 16, 0] (* Michael De Vlieger, Dec 06 2018 *)
  • PARI
    a(n) = prime(n!)
    
  • Python
    from sympy import prime, factorial
    for n in range(0,14): print(prime(factorial(n))) # Stefano Spezia, Dec 07 2018

Formula

a(n) = A000040(A000142(n)).

Extensions

a(15)-a(19) from Jens Kruse Andersen, May 08 2010
a(20)-a(21) from Henri Lifchitz, Sep 09 2014

A325094 Write n as a sum of distinct powers of 2, then take the primes of those powers of 2 and multiply them together.

Original entry on oeis.org

1, 2, 3, 6, 7, 14, 21, 42, 19, 38, 57, 114, 133, 266, 399, 798, 53, 106, 159, 318, 371, 742, 1113, 2226, 1007, 2014, 3021, 6042, 7049, 14098, 21147, 42294, 131, 262, 393, 786, 917, 1834, 2751, 5502, 2489, 4978, 7467, 14934, 17423, 34846, 52269, 104538, 6943
Offset: 0

Views

Author

Gus Wiseman, Mar 27 2019

Keywords

Comments

The sorted sequence is A325093.
For example, 11 = 1 + 2 + 8, so a(11) = prime(1) * prime(2) * prime(8) = 114.

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    2: {1}
    3: {2}
    6: {1,2}
    7: {4}
   14: {1,4}
   21: {2,4}
   42: {1,2,4}
   19: {8}
   38: {1,8}
   57: {2,8}
  114: {1,2,8}
  133: {4,8}
  266: {1,4,8}
  399: {2,4,8}
  798: {1,2,4,8}
   53: {16}
  106: {1,16}
  159: {2,16}
  318: {1,2,16}
  371: {4,16}
		

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(2^i),i=0..10)]:
    f:= proc(n) local L,i;
      L:= convert(n,base,2);
      mul(P[i]^L[i],i=1..nops(L))
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 28 2019
  • Mathematica
    Table[Times@@MapIndexed[If[#1==0,1,Prime[2^(#2[[1]]-1)]]&,Reverse[IntegerDigits[n,2]]],{n,0,100}]

A119772 a(n) = prime(4^n).

Original entry on oeis.org

2, 7, 53, 311, 1619, 8161, 38873, 180503, 821641, 3681131, 16290047, 71378569, 310248241, 1339484197, 5750079047, 24563311309, 104484802057, 442795487221, 1870358526653, 7877263558621, 33089240375501, 138666449011757, 579863159340527, 2420094683001859, 10082409897709157
Offset: 0

Views

Author

Jim Snow (jsnow(AT)mitre.org), Jun 22 2006

Keywords

Crossrefs

Cf. A033844.

Programs

Formula

a(n) = A033844(2*n). - Amiram Eldar, Jun 06 2024

Extensions

a(20)-a(24) from Charles R Greathouse IV, Nov 02 2014

A324927 Matula-Goebel numbers of rooted trees of depth 2. Numbers that are not powers of 2 but whose prime indices are all powers of 2.

Original entry on oeis.org

3, 6, 7, 9, 12, 14, 18, 19, 21, 24, 27, 28, 36, 38, 42, 48, 49, 53, 54, 56, 57, 63, 72, 76, 81, 84, 96, 98, 106, 108, 112, 114, 126, 131, 133, 144, 147, 152, 159, 162, 168, 171, 189, 192, 196, 212, 216, 224, 228, 243, 252, 262, 266, 288, 294, 304, 311, 318
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2019

Keywords

Comments

Numbers n such that A109082(n) = 2.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Also Heinz numbers of integer partitions into powers of 2 with at least one part > 1 (counted by A102378).

Examples

			The sequence of terms together with their prime indices begins:
   3: {2}
   6: {1,2}
   7: {4}
   9: {2,2}
  12: {1,1,2}
  14: {1,4}
  18: {1,2,2}
  19: {8}
  21: {2,4}
  24: {1,1,1,2}
  27: {2,2,2}
  28: {1,1,4}
  36: {1,1,2,2}
  38: {1,8}
  42: {1,2,4}
  48: {1,1,1,1,2}
  49: {4,4}
  53: {16}
  54: {1,2,2,2}
  56: {1,1,1,4}
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],And[!IntegerQ[Log[2,#]],And@@Cases[FactorInteger[#],{p_,_}:>IntegerQ[Log[2,PrimePi[p]]]]]&]

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

A336321 a(n) = A122111(A225546(n)).

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 19, 6, 9, 11, 53, 10, 131, 23, 13, 8, 311, 15, 719, 22, 29, 59, 1619, 14, 49, 137, 21, 46, 3671, 17, 8161, 12, 61, 313, 37, 25, 17863, 727, 139, 26, 38873, 31, 84017, 118, 39, 1621, 180503, 20, 361, 77, 317, 274, 386093, 33, 71, 58, 733, 3673, 821641, 34, 1742537, 8167, 87, 18, 151, 67, 3681131, 626, 1627, 41, 7754077, 35, 16290047
Offset: 1

Views

Author

Antti Karttunen and Peter Munn, Jul 17 2020

Keywords

Comments

A122111 and A225546 are both self-inverse permutations of the positive integers based on prime factorizations, and they share further common properties. For instance, they map the prime numbers to powers of 2: A122111 maps the k-th prime to 2^k, whereas A225546 maps it to 2^2^(k-1).
In composing these permutations, this sequence maps the squarefree numbers, as listed in A019565, to the prime numbers in increasing order; and the list of powers of 2 to the "normal" numbers (A055932), as listed in A057335.

Examples

			From _Peter Munn_, Jan 04 2021: (Start)
In this set of examples we consider [a(n)] as a function a(.) with an inverse, a^-1(.).
First, a table showing mapping of the powers of 2:
  n     a^-1(2^n) =    2^n =        a(2^n) =
        A001146(n-1)   A000079(n)   A057335(n)
  0             (1)         1            1
  1               2         2            2
  2               4         4            4
  3              16         8            6
  4             256        16            8
  5           65536        32           12
  6      4294967296        64           18
  ...
Next, a table showing mapping of the squarefree numbers, as listed in A019565 (a lexicographic ordering by prime factors):
  n   a^-1(A019565(n))   A019565(n)      a(A019565(n))   a^2(A019565(n))
      Cf. {A337533}      Cf. {A005117}   = prime(n)      = A033844(n-1)
  0              1               1             (1)               (1)
  1              2               2               2                 2
  2              3               3               3                 3
  3              8               6               5                 7
  4              6               5               7                19
  5             12              10              11                53
  6             18              15              13               131
  7            128              30              17               311
  8              5               7              19               719
  9             24              14              23              1619
  ...
As sets, the above columns are A337533, A005117, A008578, {1} U A033844.
Similarly, we get bijections between sets A000290\{0} -> {1} U A070003; and {1} U A335740 -> A005408 -> A066207.
(End)
		

Crossrefs

A122111 composed with A225546.
Cf. A336322 (inverse permutation).
Other sequences used in a definition of this sequence: A000040, A000188, A019565, A248663, A253550, A253560.
Sequences used to express relationship between terms of this sequence: A003159, A003961, A297002, A334747.
Cf. A057335.
A mapping between the binary tree sequences A334866 and A253563.
Lists of sets (S_1, S_2, ... S_j) related by the bijection defined by the sequence: (A000290\{0}, {1} U A070003), ({1} U A001146, A000079, A055932), ({1} U A335740, A005408, A066207), (A337533, A005117, A008578, {1} U A033844).

Formula

a(n) = A122111(A225546(n)).
Alternative definition: (Start)
Write n = m^2 * A019565(j), where m = A000188(n), j = A248663(n).
a(1) = 1; otherwise for m = 1, a(n) = A000040(j), for m > 1, a(n) = A253550^j(A253560(a(m))).
(End)
a(A000040(m)) = A033844(m-1).
a(A001146(m)) = 2^(m+1).
a(2^n) = A057335(n).
a(n^2) = A253560(a(n)).
For n in A003159, a(2n) = b(a(n)), where b(1) = 2, b(n) = A253550(n), n >= 2.
More generally, a(A334747(n)) = b(a(n)).
a(A003961(n)) = A297002(a(n)).
a(A334866(m)) = A253563(m).
Previous Showing 11-20 of 67 results. Next