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 10 results.

A136366 Numbers k such that A024530(k) is prime.

Original entry on oeis.org

3, 4, 5, 10, 21, 31, 55, 77, 121, 135, 148, 192, 425, 570, 612, 649, 1293, 2326, 3646
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Crossrefs

Cf. A024530 (numerator of Sum_{k=1..n} (-1)^k / prime(k)).

Programs

  • Mathematica
    f=0; Do[ p=Prime[n]; f=f + (-1)^(n+1)*1/p; g=Numerator[f] ;If[ PrimeQ[g], Print[ {n, g} ] ], {n, 1, 150} ]

Extensions

a(12)-a(16) from Alexander Adamchuk, Sep 15 2010
a(17)-a(19) from Robert Price, Aug 27 2019

A078437 Decimal expansion of sum of alternating series of reciprocals of primes.

Original entry on oeis.org

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

Views

Author

G. L. Honaker, Jr., Dec 31 2002

Keywords

Comments

Verified and extended by Chris K. Caldwell and Jud McCranie.
Next two terms are most likely 4 and 5. - Robert Price, Sep 13 2011
From Jon E. Schoenfield, Nov 25 2018: (Start)
Let f(k) be the k-th partial sum of the alternating series, i.e., f(k) = Sum_{j=1..k} ((-1)^(j+1))/prime(j). At large values of k, successive first differences f(k) - f(k-1) = ((-1)^(k+1))/prime(k) are alternatingly positive and negative and are nearly the same in absolute value, so f(k) is alternatingly above (for odd k) or below (for even k) the value of the much smoother function g(k) = (f(k-1) + f(k))/2 (a two-point moving average of the function f()).
Additionally, since the first differences f(k) - f(k-1) are decreasing in absolute value, g(k) will be less than both g(k-1) and g(k+1) for odd k, and greater than both for even k; i.e., g(), although much smoother than f(), is also alternatingly below or above the value of the still smoother function h(k) = (g(k-1) + g(k))/2 = ((f(k-2) + f(k-1))/2 + (f(k-1) + f(k))/2)/2 = (f(k-2) + 2*f(k-1) + f(k))/4. Evaluated at k = 2^m for m = 1, 2, 3, ..., the values of h(k) converge fairly quickly toward the limit of the alternating series:
h(k) =
k (f(k-2) + 2*f(k-1) + f(k))/4
========== ============================
2 0.29166666666666666...
4 0.28095238095238095...
8 0.26875529011751921...
16 0.27058892362329746...
32 0.27009944617052797...
64 0.26963971020080367...
128 0.26959147218377685...
256 0.26959653902072193...
512 0.26960402179695026...
1024 0.26960568606633210...
2048 0.26960649673621509...
4096 0.26960645080540929...
8192 0.26960627432070023...
16384 0.26960633643086948...
32768 0.26960634835658329...
65536 0.26960635083481533...
131072 0.26960635144743392...
262144 0.26960635199009778...
524288 0.26960635199971603...
1048576 0.26960635195886861...
2097152 0.26960635197214933...
4194304 0.26960635197019215...
8388608 0.26960635197186919...
16777216 0.26960635197171149...
33554432 0.26960635197146884...
67108864 0.26960635197167534...
134217728 0.26960635197167145...
268435456 0.26960635197166927...
536870912 0.26960635197167200...
1073741824 0.26960635197167416...
2147483648 0.26960635197167454...
4294967296 0.26960635197167462... (End)
The above mentioned average functions can also be written g(k) = f(k) + (-1)^k/prime(k)/2 and h(k) = g(k) + (-1)^k (1/prime(k) - 1/prime(k-1))/4 = f(k) + (-1)^k (3/prime(k) - 1/prime(k-1))/4. - M. F. Hasler, Feb 20 2024

Examples

			1/2 - 1/3 + 1/5 - 1/7 + 1/11 - 1/13 + ... = 0.26960635197167...
		

References

  • S. R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, pp. 94-98.

Crossrefs

Cf. A024530 (numerator of partial sums), A002110 (denominators: primorials).

Programs

  • Mathematica
    s = NSum[ p=Prime[k//Round]; (-1)^k/p, {k, 1, Infinity}, WorkingPrecision -> 30, NSumTerms -> 5*10^7, Method -> "AlternatingSigns"]; RealDigits[s, 10, 14] // First (* Jean-François Alcover, Sep 02 2015 *)
  • PARI
    L=2^N=1; h=List([1/4, 1/6 + S=.5-1/o=3]); forprime(p=o+1,oo, S+=(-1)^L/p; L--|| print([L=2^N++, p, S, listput(h, S+(3/p-1/o)/4)]); o=p) \\ in PARI version > 2.13 listput() may not return the element so one must add +h[#h]
    A(x,n=#x)=(x[n]*x[n-2]-x[n-1]^2)/(x[n]+x[n-2]-2*x[n-1]) \\ This is Aitken's Delta-square extrapolation for the last 3 elements of the list x. One can check that the extrapolation is useful for the sequence of raw partial sums (f(2^k)), but not for the smooth/average sequence (h(2^k)). - M. F. Hasler, Feb 20 2024

Formula

c = lim_{n -> oo} A024530(n)/A002110(n). - M. F. Hasler, Feb 20 2024

Extensions

Values of a(11)-a(14) = 7,1,6,7 from Robert Price, Sep 13 2011

A136370 Numerator of 1 - Sum_{k=1..n} (-1)^(k+1)/prime(k)^2.

Original entry on oeis.org

3, 31, 739, 37111, 4446331, 756766039, 217803584371, 78887714418031, 41637516941042299, 35066922176061410359, 33657455280704707522099, 46117280789485930425170431, 77468081652660425646977758411, 143331051198625503752852285686039
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Comments

It seems that the denominator of 1 - Sum_{k=1..n} (-1)^(k+1)/prime(k)^2 is A061742(n), which is the square of the product of the first n primes, but this is not immediately obvious. - Petros Hadjicostas, May 14 2020

Examples

			The first few fractions are 3/4, 31/36, 739/900, 37111/44100, 4446331/5336100, 756766039/901800900, ... = A136370/A061742. - _Petros Hadjicostas_, May 14 2020
		

Crossrefs

Possible denominators are A061742.

Programs

  • Mathematica
    Table[Numerator[1 - Sum[(-1)^(k+1)/Prime[k]^2, {k, 1, n}]], {n, 1, 20}]
  • PARI
    a(n) = numerator(1 - sum(k=1, n, (-1)^(k+1)/prime(k)^2)); \\ Michel Marcus, May 14 2020
    
  • Python
    from sympy import prime
    from fractions import Fraction
    from itertools import accumulate, count, islice
    def A136370gen(): yield from map(lambda x: (1-x).numerator, accumulate(Fraction((-1)**(k+1), prime(k)**2) for k in count(1)))
    print(list(islice(A136370gen(), 14))) # Michael S. Branicky, Jun 26 2022

Formula

A136370/A061742 tends to 1 - A242301 = 0.83718375333639858423166... - Vaclav Kotesovec, May 14 2020

Extensions

Definition corrected by Alexander Adamchuk, Sep 15 2010
a(14) and beyond from Michael S. Branicky, Jun 26 2022

A136368 Numerator of Sum_{k=1..n} (-1)^(k+1)/prime(k)^2.

Original entry on oeis.org

1, 5, 161, 6989, 889769, 145034861, 42816875729, 15196271678069, 8132911703794601, 6790008314246422541, 6567054920481119894801, 8950073675937467308565669, 15100141203716305943432625689
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Crossrefs

Programs

  • Magma
    [Numerator(&+[(-1)^(k+1)/NthPrime(k)^2:k in [1..n]]): n in [1..13]]; // Marius A. Burtea, Aug 26 2019
  • Mathematica
    Table[Numerator[Sum[(-1)^(k+1)/Prime[k]^2, {k, 1, n}]], {n, 1, 20}]

A136369 Numbers k such that A136368(k) is prime.

Original entry on oeis.org

2, 5, 6, 8, 18, 20, 98, 1863
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Crossrefs

Cf. A024530 (numerator of Sum_{k=1..n} (-1)^k / prime(k)).
Cf. A136368 (numerator of Sum_{k=1..n} (-1)^(k+1)/prime(k)^2).

Programs

  • Mathematica
    f=0; Do[ p=Prime[n]; f=f + (-1)^(n+1)*1/p^2; g=Numerator[f] ;If[ PrimeQ[g], Print[ {n, g} ] ], {n, 1, 100} ]

Extensions

a(8) from Robert Price, Aug 28 2019

A136371 Numbers k such that A136370(k) is prime.

Original entry on oeis.org

1, 2, 3, 5, 46, 227, 232, 336, 360, 3919
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Crossrefs

Cf. A024530: numerator of Sum_{k=1..n} (-1)^k/prime(k).
Cf. A136368: numerator of Sum_{k=1..n} (-1)^(k+1)/prime(k)^2.
Cf. A136370: numerator of 1 - Sum_{k=1..n} (-1)^(k+1)/prime(k)^2.

Programs

  • Mathematica
    f=1; Do[ p=Prime[n]; f=f - (-1)^(n+1)*1/p^2; g=Numerator[f] ;If[ PrimeQ[g], Print[ {n, g} ] ], {n, 1, 100} ]
  • Python
    # uses A136370gen() and imports from A136370
    from sympy import isprime
    def agen(): yield from (k for k, ak in enumerate(A136370gen(), 1) if isprime(ak))
    print(list(islice(agen(), 5))) # Michael S. Branicky, Jun 26 2022

Extensions

More terms added and edited by Alexander Adamchuk, Sep 15 2010
a(10) from Robert Price, Aug 29 2019

A136367 Numbers k such that A024529(k+1) is prime.

Original entry on oeis.org

2, 3, 4, 5, 11, 59, 397, 613, 906, 1560, 2162, 2915, 5211
Offset: 1

Views

Author

Alexander Adamchuk, Dec 27 2007

Keywords

Comments

A024529(n+1) = numerator of 1 + Sum_{j=1..n} (-1)^j/prime(j): 1, 5, 19, 163, 1583, 22889, 359083, 7333087, 158961311, 4832970889, 143352404329, ...

Crossrefs

Cf. A024529: numerator of 1 + Sum_{k=1..n-1} (-1)^k/prime(k).

Programs

  • Mathematica
    f=1; Do[ p=Prime[n]; f=f + (-1)^n*1/p; g=Numerator[f] ;If[ PrimeQ[g], Print[ {n, g} ] ], {n, 1, 60} ]

Extensions

a(7)-a(9) from Alexander Adamchuk, Sep 15 2010
a(10) from Vincenzo Librandi, Aug 26 2019
a(11)-a(13) from Robert Price, Aug 29 2019

A140123 Denominator of Sum_{k=1..n} (-1)^k / semiprime(k).

Original entry on oeis.org

4, 12, 36, 180, 1260, 252, 252, 2772, 69300, 900900, 900900, 15315300, 15315300, 290990700, 290990700, 6692786100, 46849502700, 46849502700, 46849502700, 46849502700, 1358635578300, 42117702927300, 42117702927300, 42117702927300
Offset: 1

Views

Author

Jonathan Vos Post, May 09 2008

Keywords

Examples

			The first 10 values of A140122(n)/a(n) = -1/4, -1/12, -7/36, -17/180, -209/1260, -25/252, -37/252, -281/2772, -9797/69300, -92711/900900. The 10th term of the sum is (-1/4)+(1/6)-(1/9)+(1/10)-(1/14)+(1/15)-(1/21)+(1/22)-(1/25)+(1/26) = -92711/900900 hence a(10) = 900900. The 20th term of the alternating sum is (-1/4)+(1/6)-(1/9)+(1/10)-(1/14)+(1/15)-(1/21)+(1/22)-(1/25)+(1/26)-(1/33)+(1/34)-(1/35)+(1/38)-(1/39)+(1/46)-(1/49)+(1/51)-(1/55)+(1/57) = -5218865543/46849502700, hence a(20) = 46849502700.
		

Crossrefs

Programs

  • Maple
    A001358 := proc(n) local a; if n = 1 then 4; else for a from A001358(n-1)+1 do if numtheory[bigomega](a) = 2 then RETURN(a) ; fi ; od: fi ; end: A140123 := proc(n) local k ; denom(add ( (-1)^k/A001358(k),k=1..n)) ; end: seq(A140123(n),n=1..30) ; # R. J. Mathar, May 13 2008

Extensions

More terms from R. J. Mathar, May 13 2008

A140122 Negative of numerator of Sum_{k=1..n} (-1)^k / semiprime(k).

Original entry on oeis.org

1, 1, 7, 17, 209, 25, 37, 281, 9797, 92711, 120011, 1589737, 2027317, 30861373, 38322673, 735926129, 6107595203, 5188977503, 6040786643, 5218865543, 174771852097, 4738609625857, 5386574286277, 4776172794577, 197777244862999
Offset: 1

Views

Author

Jonathan Vos Post, May 09 2008

Keywords

Examples

			The first 10 values of a(n)/A140123(n) = -1/4, -1/12, -7/36, -17/180, -209/1260, -25/252, -37/252, -281/2772, -9797/69300, -92711/900900. The 10th term of the sum is (-1/4)+(1/6)-(1/9)+(1/10)-(1/14)+(1/15)-(1/21)+(1/22)-(1/25)+(1/26) = -92711/900900 hence a(10) = -(-92711) = 92711. The 20th term of the alternating sum is (-1/4)+(1/6)-(1/9)+(1/10)-(1/14)+(1/15)-(1/21)+(1/22)-(1/25)+(1/26)-(1/33)+(1/34)-(1/35)+(1/38)-(1/39)+(1/46)-(1/49)+(1/51)-(1/55)+(1/57) = -5218865543/46849502700, hence a(20) = 5218865543.
		

Crossrefs

Programs

  • Maple
    A001358 := proc(n) local a; if n = 1 then 4; else for a from A001358(n-1)+1 do if numtheory[bigomega](a) = 2 then RETURN(a) ; fi ; od: fi ; end: A140122 := proc(n) local k ; numer(-add ( (-1)^k/A001358(k),k=1..n)) ; end: seq(A140122(n),n=1..30) ; # R. J. Mathar, May 13 2008

Extensions

Corrected and extended by R. J. Mathar, May 13 2008

A332399 Minimum positive value of p_1*...*p_n*(s_1/p_1 + ... + s_n/p_n), where each s_i equals 1 or -1 and p_i is the i-th prime number.

Original entry on oeis.org

1, 1, 1, 23, 43, 251, 263, 21013, 1407079, 4919311, 818778281, 2402234557, 379757743297, 3325743954311, 54237719914087, 903944329576111, 46919460458733911, 367421942920402841, 17148430651130576323, 1236225057834436760243, 4190310920096832376289, 535482916756698482410061
Offset: 1

Views

Author

Alessandro Gambini, Feb 11 2020

Keywords

Examples

			(2*3*5*7)*(1/2 - 1/3 - 1/5 + 1/7) = (210)*(23/210) = 23, so a(4) = 23.
		

Crossrefs

Cf. A061194 (with integers), A024530.

Programs

  • Mathematica
    a[n_] := Block[{p = Prime@ Range@ n}, Min@ Abs[{1/p}.Transpose@ Tuples[{-1, 1}, n]] Times @@ p]; Array[a, 16] (* Giovanni Resta, Feb 11 2020 *)
Showing 1-10 of 10 results.