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

A232221 a(n) = Sum_{i=1..n} (A077068(i) - A077065(i)).

Original entry on oeis.org

0, 0, 4, 20, 36, 52, 128, 216, 328, 464, 636, 796, 908, 1092, 1324, 1520, 1716, 1948, 2144, 2436, 2716, 2972, 3264, 3580, 3812, 4032, 4168, 4268, 4416, 4720, 5012, 5328, 5716, 6128, 6504, 6700, 6932, 7248, 7684, 8180, 8676, 9268, 9680, 10140, 10624, 11024, 11400
Offset: 1

Views

Author

N. J. A. Sloane, Nov 22 2013, based on a posting by V.J. Pohjola to the Sequence Fans Mailing List, Nov 22 2013

Keywords

Comments

The sequence has wild fluctuations - see the successive plots in the links. This is typical behavior for a particle whose movement is governed by an arc-sine law (cf. Feller, Chap. III). - N. J. A. Sloane, Nov 23 2013
Negative stretches: terms 941-1031 and 13197-1431205. - Hans Havermann, Nov 23 2013
After reaching a local maximum of 21957005755012 at term 24118371, the sequence again descends with the first negative of a third such stretch at term 32437583. - Hans Havermann, Nov 28 2013
All terms are multiples of 4, cf. A008586. - Reinhard Zumkeller, Nov 22 2013
See A232361 and A232359 for peak values and where they occur: max{a(A232359(n)-1), a(A232359(n)+1)} < a(A232359(n)) = A232361(n). - Reinhard Zumkeller, Nov 24 2013

References

  • W. Feller, An Introduction to Probability Theory and its Applications, 3rd ed, Wiley, New York, 1968.

Crossrefs

Partial sums of A232342.

Programs

  • Haskell
    a232221 n = a232221_list !! (n-1)
    a232221_list = scanl1 (+) a232342_list
    -- Reinhard Zumkeller, Dec 16 2013, Nov 22 2013

A232342 A077068(n) minus A077065(n).

Original entry on oeis.org

0, 0, 4, 16, 16, 16, 76, 88, 112, 136, 172, 160, 112, 184, 232, 196, 196, 232, 196, 292, 280, 256, 292, 316, 232, 220, 136, 100, 148, 304, 292, 316, 388, 412, 376, 196, 232, 316, 436, 496, 496, 592, 412, 460, 484, 400, 376, 412, 556, 736, 1000, 940, 1012
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 16 2013

Keywords

Comments

All terms are multiples of 4, cf. A008586;
a(n) = A077068(n) - A077065(n).
First term < 0: a(426) = -104.

Crossrefs

Cf. A232221 (partial sums).

Programs

  • Haskell
    a232342 n = a232342_list !! (n-1)
    a232342_list = zipWith (-) a077068_list a077065_list

A077065 Semiprimes of form prime - 1.

Original entry on oeis.org

4, 6, 10, 22, 46, 58, 82, 106, 166, 178, 226, 262, 346, 358, 382, 466, 478, 502, 562, 586, 718, 838, 862, 886, 982, 1018, 1186, 1282, 1306, 1318, 1366, 1438, 1486, 1522, 1618, 1822, 1906, 2026, 2038, 2062, 2098, 2206, 2446, 2458, 2578, 2818, 2878, 2902
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 23 2002

Keywords

Comments

There are 670 semiprimes of form prime-1 below 10^5.

Examples

			A001358(16) = 46 = 2*23 is a term as 46 = A000040(15) - 1 = 47 - 1.
		

Crossrefs

Intersection of A006093 and A001358.
Intersection of A006093 and A100484.

Programs

  • Haskell
    a077065 n = a077065_list !! (n-1)
    a077065_list = filter ((== 1) . a010051' . (`div` 2)) a006093_list
    -- Reinhard Zumkeller, Nov 22 2013, Oct 27 2012
    
  • Magma
    IsSemiprime:=func; [s: n in [2..500] | IsSemiprime(s) where s is NthPrime(n)-1]; // Vincenzo Librandi, Oct 17 2012
    
  • Maple
    q:= n-> (n::even) and andmap(isprime, [n+1, n/2]):
    select(q, [$1..5000])[];  # Alois P. Heinz, Jul 19 2023
  • Mathematica
    Select[Range[6000],Plus@@Last/@FactorInteger[#]==2&&PrimeQ[#+1]&] (* Vladimir Joseph Stephan Orlovsky, May 08 2011 *)
    Select[Range[3000],PrimeOmega[#]==2&&PrimeQ[#+1]&] (* Harvey P. Dale, Oct 16 2012 *)
    Select[ Prime@ Range@ 430 - 1, PrimeOmega@# == 2 &] (* Robert G. Wilson v, Feb 18 2014 *)
  • PARI
    [x-1|x<-primes(10^4),bigomega(x-1)==2] \\ Charles R Greathouse IV, Nov 22 2013

Formula

a(n) = A005385(n) - 1 = 2*A005384(n).
A010051(A006093(a(n))/2) = A064911(A006093(a(n))) = 1. - Reinhard Zumkeller, Nov 22 2013
a(n) = A077068(n) - A232342(n). - Reinhard Zumkeller, Dec 16 2013
a(n) = A000010(A194593(n+1)). - Torlach Rush, Aug 23 2018
A000010((a(n)*2)+2) = A023900((a(n)*2)+2). - Torlach Rush, Aug 23 2018

A121885 Excess of n-th prime over previous semiprime.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Aug 31 2006

Keywords

Comments

See: A102415 Greatest semiprime less than n-th prime. See: A102414 Smallest semiprime greater than n-th prime.

Crossrefs

Programs

  • Mathematica
    SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] - 1; While[! SemiPrimeQ[i], i--]; Prime[n] - i, {n, 3, 100}] (* T. D. Noe, Oct 08 2012 *)
    eps[n_]:=Module[{c=n-1},While[PrimeOmega[c]!=2,c--];n-c]; Table[eps[n],{n,Prime[Range[3,90]]}] (* Harvey P. Dale, Aug 12 2014 *)
  • PARI
    dsemi(n)= { local(k=0); if(isprime(n),k=0;while(bigomega(n-k)<>2&&kAntonio Roldán, Oct 08 2012

Formula

a(n) = Min{A000040(n)-s for s < A000040(n) and s in A001358(k)}. a(n) = A000040(n) - A102415(n).

Extensions

Extended by T. D. Noe, Oct 08 2012

A121884 Excess of n-th semiprime over previous prime.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Aug 31 2006

Keywords

Comments

a(n) = 1 iff n is in A077068. a(n) = 2 iff n is in A062721.

Crossrefs

Programs

  • Mathematica
    semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; lst1 = Select[ Range@ 325, semiPrimeQ@# &]; lst = Select[ Range@ 500, semiPrimeQ@# &]; lst - (NextPrime[ #, -1] & /@ lst) (* Robert G. Wilson v, Mar 16 2009 *)
    #-NextPrime[#,-1]&/@Select[Range[400],PrimeOmega[#]==2&] (* Harvey P. Dale, Feb 15 2018 *)

Formula

a(n) = Min{A001358(n)-p for p < A001358(n) and p in A000040(k)}.

Extensions

a(31)-a(103) from Robert G. Wilson v, Mar 16 2009

A243016 Number of solutions for k*n/(k+n) = p for integer k > 0 and prime p.

Original entry on oeis.org

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

Views

Author

Derek Orr, May 29 2014

Keywords

Comments

It is unknown whether a(6) = 3 is the highest number in this sequence.
No terms higher than 3 among the first 10000 terms. - Antti Karttunen, Jan 20 2025
a(n) is the number of primes among n-1, n/2 and q, where q satisfies q*(q+1)=n. So a(n) <= 2 for n > 6, and a(n) = 2 iff n != 6 is in A053185 + 1 or A077068. - Jinyuan Wang, Jan 20 2025

Examples

			4*k/(4+k) has two solutions: k=4, p=2 and k=12, p=3. Thus a(4) = 2.
From _Antti Karttunen_, Jan 18 2025: (Start)
For n=3, the ratio (k*n)/(k+n) obtains for k=1..3*(3-1) the values 3/4, 6/5, 3/2, 12/7, 15/8, 2, and only the last one of these is prime, therefore a(3) = 1.
For n=26, the only k such that (k*n)/(k+n) is a prime, is k=26, with (26^2)/(2*26) = 13, therefore a(26) = 1. (End)
		

Crossrefs

Programs

  • PARI
    A243016(n) = { my(s); sum(k=1, n*(n-1), s = (k*n)/(k+n); (1==denominator(s) && isprime(s))); }; \\ Edited by Antti Karttunen, Jan 18 2025

Formula

a(n) <= A063647(n). - Antti Karttunen, Jan 18 2025

Extensions

Data section extended up to a(105) and incorrect terms, that were caused by dropping of a(26) and a(27) (first discrepancies at n=26, 28, 30, 34, etc.) corrected by Antti Karttunen, Jan 18 2025

A276983 Semiprimes n such that n-1 or n+1 is prime.

Original entry on oeis.org

4, 6, 10, 14, 22, 38, 46, 58, 62, 74, 82, 106, 158, 166, 178, 194, 226, 262, 278, 314, 346, 358, 382, 398, 422, 458, 466, 478, 502, 542, 562, 586, 614, 662, 674, 718, 734, 758, 838, 862, 878, 886, 982, 998, 1018, 1094, 1154, 1186, 1202, 1214, 1238, 1282, 1306, 1318, 1322
Offset: 1

Views

Author

Gary E. Davis, Sep 24 2016

Keywords

Comments

Union of A077065 and A077068.

Examples

			a(3) = 10 = 2*5 is a product of 2 primes and 10+1 = 11 is prime.
a(4) = 14 = 2*7 is a product of 2 primes and 14-1 = 13 is prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t/2) and (isprime(t-1) or isprime(t+1)), [seq(i,i=2..10000,2)]); # Robert Israel, Sep 30 2016
  • Mathematica
    func[n_] := PrimeOmega[n] == 2 && (PrimeQ[n + 1] || PrimeQ[n - 1])
    Select[Range[1000], func[#] &]
  • PARI
    isok(n) = (bigomega(n)==2) && (isprime(n-1) || isprime(n+1)); \\ Michel Marcus, Sep 24 2016
    
  • PARI
    lista(nn) = forprime(p=2, nn, if(isprime(2*p+1) || isprime(2*p-1), print1(2*p, ", "))); \\ Altug Alkan, Sep 30 2016
    
  • Python
    from sympy import isprime, primerange
    def aupto(N): return [t for t in (2*p for p in primerange(2, N//2+1)) if isprime(t-1) or isprime(t+1)]
    print(aupto(1322)) # Michael S. Branicky, Aug 21 2022

Formula

a(n) = 2*A120628(n).

A233973 a(n) = A232221(n)/4.

Original entry on oeis.org

0, 0, 1, 5, 9, 13, 32, 54, 82, 116, 159, 199, 227, 273, 331, 380, 429, 487, 536, 609, 679, 743, 816, 895, 953, 1008, 1042, 1067, 1104, 1180, 1253, 1332, 1429, 1532, 1626, 1675, 1733, 1812, 1921, 2045, 2169, 2317, 2420, 2535, 2656, 2756, 2850, 2953
Offset: 1

Views

Author

Omar E. Pol, Dec 18 2013

Keywords

Crossrefs

Formula

a(n) = (Sum_{i=1..n} (A077068(i)-A077065(i)))/4.
Showing 1-8 of 8 results.