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.

User: Pedro Caceres

Pedro Caceres's wiki page.

Pedro Caceres has authored 17 sequences. Here are the ten most recent ones:

A332188 a(n) = (1/e^n) * Sum_{j>=2} j^n * n^j / (j-2)!.

Original entry on oeis.org

0, 3, 72, 1557, 36928, 986550, 29641608, 994006209, 36887753216, 1502798312547, 66730937637400, 3209318261685690, 166242143849148864, 9229638177763268395, 546842961612529341032, 34443269219453881669425
Offset: 0

Author

Pedro Caceres, Oct 30 2020

Keywords

Examples

			a(3) = 1557 = (1/e^3) * Sum_{j>=2} j^3 * 3^j / factorial(j-2).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[n^k*(StirlingS2[n + 2, k] - StirlingS2[n + 1, k]), {k, 2, n + 2}]; Array[a, 16, 0] (* Amiram Eldar, Oct 30 2020 *)
  • PARI
    a(n) = sum(k=0, n+2, n^k*(stirling(n+2,k,2) - stirling(n+1,k,2))); \\ Michel Marcus, Oct 30 2020
  • SageMath
    # Increase precision for larger n!
    R = RealField(100)
    t = 2
    sol = [0]*18
    for n in range(0, 18):
        suma = R(0)
        for j in range(t, 1000):
            suma += (j^n * n^j) / factorial(j - t)
        suma *= exp(-n)
        sol[n] = round(suma)
    print(sol) # Thanks to Peter Luschny for his example in A338282.
    

Formula

a(n) = Sum_{k=0..n+2} n^k*(Stirling2(n+2,k) - Stirling2(n+1,k)). [Thanks to Andrew Howroyd for his example in A338282]

A338282 a(n) = (1/e^n) * Sum_{j>=3} j^n * n^j / (j-3)!.

Original entry on oeis.org

0, 4, 216, 7371, 239424, 8127875, 296315496, 11685617608, 498593804800, 22959117809685, 1137033860419000, 60338078785131785, 3418430599382500800, 206053517402599981504, 13172124530670958537160, 890361160360138336174875, 63463906792476058870550528, 4758276450884470061869230823
Offset: 0

Author

Pedro Caceres, Oct 20 2020

Keywords

Examples

			a(3) = 7371 = (1/e^3) * Sum_{j>=3} j^3 * 3^j / factorial(j-3).
		

Crossrefs

Programs

  • Maple
    seq(add(n^(k+3)*A143495(n+3, k+3), k = 0..n), n = 0..17); # Peter Luschny, Oct 21 2020
  • Mathematica
    a[n_] := Exp[-n] * Sum[j^n * n^j/(j - 3)!, {j, 3, Infinity}]; Array[a, 17, 0] (* Amiram Eldar, Oct 20 2020 *)
  • PARI
    a(n)={sum(k=0, n+3, n^k*(stirling(n+3,k,2) - 3*stirling(n+2,k,2) + 2*stirling(n+1,k,2)))} \\ Andrew Howroyd, Oct 20 2020
  • SageMath
    # Increase precision for larger n!
    R = RealField(100)
    t = 3
    sol = [0]*18
    for n in range(0, 18):
        suma = R(0)
        for j in range(t, 1000):
            suma += (j^n * n^j) / factorial(j - t)
        suma *= exp(-n)
        sol[n] = round(suma)
    print(sol) # Peter Luschny, Oct 20 2020
    

Formula

a(n) = Sum_{k=0..n+3} n^k*(Stirling2(n+3,k) - 3*Stirling2(n+2,k) + 2*Stirling2(n+1,k)). - Andrew Howroyd, Oct 20 2020
a(n) = Sum_{k=0..n} n^(k+3)*A143495(n+3, k+3). - Peter Luschny, Oct 21 2020

A333721 Numbers k such that k + 1, 2k + 1, 3k + 1, 4k + 1, and 6k + 1 are all prime.

Original entry on oeis.org

1530, 4260, 25410, 26040, 78540, 111720, 174990, 211050, 214830, 395430, 403260, 409290, 459690, 487830, 512820, 711120, 779790, 910560, 1023750, 1135950, 1280370, 1312350, 1451520, 1464810, 1487070, 1563510, 1623360, 1698060, 1824330, 1933680, 2006340, 2097480
Offset: 1

Author

Pedro Caceres, May 04 2020

Keywords

Comments

All terms are multiples of 6.
All terms are multiples of 30. - Robert Israel, Jun 17 2020

Examples

			25410 is in the sequence because 25411, 50821, 76231, 101641, 152461 are all prime.
		

Programs

  • Maple
    select(t -> andmap(isprime, [t+1,2*t+1,3*t+1,4*t+1,6*t+1]), [seq(i,i=30..3*10^6,30)]); # Robert Israel, Jun 17 2020
  • PARI
    isok(m)={for(i=1, 6, if(i<>5&&!isprime(i*m+1), return(0))); 1}
    { forstep(n=0, 3*10^6, 6, if(isok(n), print1(n, ", "))) } \\ Andrew Howroyd, May 04 2020

A308090 a(n) = gcd(2^n + n!, 3^n + n!, n+1).

Original entry on oeis.org

1, 1, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17, 1, 19, 1, 1, 1, 23, 1, 1, 1, 1, 1, 29, 1, 31, 1, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 1, 1, 1, 1, 53, 1, 1, 1, 1, 1, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 1, 1, 71, 1, 73, 1, 1, 1, 1, 1, 79, 1, 1, 1, 83, 1, 1, 1, 1, 1, 89, 1, 1, 1, 1, 1, 1, 1, 97, 1, 1, 1
Offset: 1

Author

Pedro Caceres, May 11 2019

Keywords

Comments

From observation: For n > 3, if n+1 is prime, then a(n) = n+1.
This implies that (2^n + n!)= 0 mod (n+1) iff (n+1) is prime, and (3^n + n!)= 0 mod (n+1) iff (n+1) is prime.
Conjecture: Conversely, if gcd(2^n + n!, 3^n + n!, n+1) = n+1, then n+1 is prime.
Appears to be the same as A090585(n) except at n=2. - R. J. Mathar, Jul 22 2021

Examples

			a(4) = gcd(2^4 + 4!, 3^4 + 4!, 5) = gcd(40, 105, 5) = 5.
a(5) = gcd(2^5 + 5!, 3^5 + 5!, 6) = gcd(152, 363, 6) = 1.
		

Crossrefs

Programs

  • Mathematica
    Table[GCD[2^n+n!,3^n+n!,n+1],{n,100}] (* Harvey P. Dale, Aug 27 2020 *)
  • PARI
    a(n) = gcd([2^n + n!, 3^n + n!, n+1]); \\ Michel Marcus, May 12 2019

Formula

a(n) = gcd(A007611(n), A249945(n), n+1).

A307642 a(n) = n!*Sum_{i=1..n} (Sum_{j=1..i} (i/j)).

Original entry on oeis.org

1, 8, 57, 428, 3510, 31644, 312984, 3380544, 39664080, 502927200, 6858181440, 100135491840, 1559197261440, 25797280723200, 452046655872000, 8364495012249600, 162994310248089600, 3336683369519001600, 71596721810396160000, 1606993396943155200000
Offset: 1

Author

Pedro Caceres, Apr 19 2019

Keywords

Examples

			a(3) = 57 because a(3) = 3!*Sum_{i=1..3} (Sum_{j=1..i} (i/j)).
		

Crossrefs

Cf. A001008/A002805 (harmonic), A182541.

Programs

  • GAP
    List([1..25], n-> n*Factorial(n+1)*(1+2*Sum([2..n+1], j-> 1/j))/4 ); # G. C. Greubel, Jul 15 2019
  • Magma
    [n*Factorial(n+1)*(2*HarmonicNumber(n+1)-1)/4: n in [1..25]]; // G. C. Greubel, Jul 15 2019
    
  • Mathematica
    Array[#!*Sum[Sum[i/j, {j, i}], {i, #}] &, 25] (* Michael De Vlieger, Apr 21 2019 *)
    Table[n*(n+1)!*(2*HarmonicNumber[n+1] -1)/4, {n, 25}] (* G. C. Greubel, Jul 15 2019 *)
  • PARI
    a(n)=n!*sum(i=1, n, sum(j=1, i, i/j)); \\ Michel Marcus, Apr 20 2019
    
  • Sage
    [n*factorial(n+1)*(2*harmonic_number(n+1)-1)/4 for n in (1..25)] # G. C. Greubel, Jul 15 2019
    

Formula

a(n) = n! * Sum_{i=1..n} (Sum_{j=1..i} (i/j)).
a(n) = n * A182541(n+2).
a(n) = (1/4) * n * (n+1)! * (2*harmonic(n+1) - 1).

A307663 a(n) = (n-1)!*(Sum_{i=1..n} Sum_{j=1..i} binomial(i,j)*i/j).

Original entry on oeis.org

1, 6, 41, 329, 3090, 33654, 420792, 5981688, 95782320, 1712555280, 33909364800, 737868052800, 17521164259200, 451126883894400, 12522623670144000, 372847351488998400, 11853064556660275200, 400718191717647820800, 14354714544806716416000, 543129329390299739136000, 21642934280974058207232000
Offset: 1

Author

Pedro Caceres, Apr 20 2019

Keywords

Examples

			a(2) = 1! * (C(1,1)*1/1 + C(2,1)*2/1 + C(2,2)*2/2) = 6.
		

Programs

  • Mathematica
    Array[(# - 1)!*Sum[Sum[Binomial[i, j] i/j, {j, i}], {i, #}] &, 21] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    a(n) = (n-1)!*sum(i=1, n, sum(j=1, i, binomial(i,j)*i/j)); \\ Michel Marcus, Apr 20 2019

Formula

Conjectures from Robert Israel, Oct 26 2020: (Start)
E.g.f. ((4*x^2 - 8*x + 5)*log(-x + 1))/(2*(x - 1)^2) - ((4*x^2 - 8*x + 5)*log(1 - 2*x))/(2*(x - 1)^2) + x*(-6 + 5*x)/(4*(x - 1)^2).
D-finite with recurrence 2*(n+3)*(n+2)*n*(n-2)*a(n) - (n+3)*(5*n^2-6*n-17)*a(n+1) + (4 n^2-n-29)* a(n+2) -(n-3)*a(n+3) = 0. (End)
The conjecture regarding the e.g.f. is true. See links. - Sela Fried, Jul 30 2024.

A322921 From Goldbach's conjecture: a(n) is the number of decompositions of 6n into a sum of two primes.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 9, 7, 8, 8, 10, 12, 10, 9, 8, 11, 12, 11, 10, 13, 11, 14, 13, 11, 13, 14, 19, 13, 11, 12, 15, 18, 16, 16, 14, 16, 19, 16, 16, 17, 19, 21, 15, 17, 15, 20, 24, 19, 17, 16, 20, 22, 18, 18, 22, 19, 27, 21, 17, 20, 21, 30
Offset: 1

Author

Pedro Caceres, Dec 30 2018

Keywords

Comments

According to Goldbach's conjecture all even numbers can be decomposed into one or more sums of two prime numbers.
Each even number N belongs to one of the following sets: {N == 0 (mod 6)}, {(N + 2) == 0 (mod 6)}, and {(N - 2) == 0 (mod 6)}.
Conjecture: In any combination of three consecutive even numbers >= 48, the one of the form N == 0 (mod 6) will have the largest number of decompositions into 2 prime numbers. This sequence contains those local maxima for every set of three consecutive even numbers. This sequence forms the upper envelope of Goldbach's comet chart.

Examples

			a(1) = 1 because 6 * 1 = 6 can be decomposed as (3 + 3);
a(8) = 5 is the number of ways that 6 * 8 = 48 can be decomposed into sums of two prime numbers: 5 + 43, 11 + 37, 17 + 31, 29 + 19, 41 + 7.
		

Crossrefs

Programs

Formula

a(n) = A002375(3*n).

A323139 Integers that are not multiples of 6 and are the sum of two consecutive primes.

Original entry on oeis.org

5, 8, 52, 68, 100, 112, 128, 152, 172, 268, 308, 320, 340, 352, 410, 434, 472, 508, 520, 532, 548, 668, 712, 740, 752, 772, 872, 892, 946, 1012, 1030, 1064, 1088, 1120, 1132, 1148, 1180, 1192, 1208, 1220, 1250, 1300, 1312, 1334, 1360, 1460, 1472, 1508, 1606, 1888, 1900, 1948, 1960, 1988, 2006, 2032, 2072, 2132, 2156
Offset: 1

Author

Pedro Caceres, Jan 05 2019

Keywords

Comments

All primes, except 2 and 3, are of the form 6k+1 or 6k-1 for k a positive integer. The converse statement is not true for all k, so the sum of two consecutive primes is not always a multiple of 6. This sequence lists the sums of two consecutive primes that are not multiple of 6.

Examples

			52 = 23 + 29 is not a multiple of 6.
		

Crossrefs

Programs

  • Maple
    p:= 2:
    count:= 0: Res:= NULL:
    while count < 100 do
      q:= nextprime(p);
      if p+q mod 6 <> 0 then
         count:= count+1; Res:= Res, p+q;
      fi;
      p:= q;
    od:
    Res; # Robert Israel, Jan 09 2019
  • Mathematica
    Select[Total /@ Partition[Prime@ Range@ 180, 2, 1], Mod[#, 6] != 0 &] (* Michael De Vlieger, Jan 07 2019 *)
  • PARI
    my(p=2); forprime(q=3, 1e3, if ((p+q) % 6, print1(p+q", ")); p=q); \\ Michel Marcus, Jan 05 2019

A323138 Multiples of 6 that are not the sum of two consecutive primes.

Original entry on oeis.org

6, 48, 54, 66, 72, 96, 102, 108, 114, 126, 132, 150, 156, 168, 174, 180, 192, 228, 234, 246, 252, 264, 270, 282, 294, 306, 312, 318, 324, 336, 342, 348, 354, 366, 378, 402, 408, 414, 420, 426, 432, 438, 444, 468, 474, 486, 498, 504, 510, 516, 522, 528, 534, 546, 552, 570, 582
Offset: 1

Author

Pedro Caceres, Jan 05 2019

Keywords

Comments

All primes, except 2 and 3, are of the form 6k+1 or 6k-1 for k a positive integer. The converse statement is not true for all k, so the sum of two consecutive primes is not always a multiple of 6. This sequence lists the multiples of 6 that cannot be expressed as a sum of two consecutive primes.

Examples

			6 belongs to the sequence because there are no two consecutive primes adding up to 6. 12 is not in the sequence because 12 = 5 + 7.
		

Crossrefs

Cf. A001043. Subsequence of A008588.

Programs

  • Mathematica
    Complement[6 Range[Last[#]/6], #] &@ Select[Total /@ Partition[Prime@ Range@ 63, 2, 1], Mod[#, 6] == 0 &] (* Michael De Vlieger, Jan 07 2019 *)
  • PARI
    isok(n) = !(n % 6) && (precprime((n-1)/2) + nextprime(n/2) != n); \\ Michel Marcus, Jan 05 2019

A305825 Number of different ways that a number between two members of a twin prime pair can be expressed as a sum of two smaller such numbers.

Original entry on oeis.org

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

Author

Pedro Caceres, Jun 10 2018

Keywords

Comments

Number of pairs i, j such that A014574(i) + A014574(j) = A014574(n) where 1 <= i <= j < n. - David A. Corneth, Aug 05 2018

Examples

			a(8)=2 because the 8th isolated composite number is 72 = 60 + 12 and 42 + 30 with (12,30,42,60) all isolated composite numbers.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(vc = select(x->(isprime(x-1) && isprime(x+1)), [1..nn])); for (n=1, #vc, nb = 0; for (j=1, n, for (k=j+1, n, if (vc[j]+vc[k] == vc[n], nb++));); print1(nb, ", "););} \\ Michel Marcus, Jul 05 2018
    
  • PARI
    first(n) = {my(isolated = List(), isomap = Map, res = vector(n), k, q = 3); forprime(p = 5, , if(p - q == 2, listput(isolated, q+1); mapput(isomap, q+1, #isolated); if(#isolated == n, break)); q = p); for(i = 1, #isolated, for(j = 1, i - 1, diff = isolated[i] - isolated[j]; if(diff < isolated[j], if( mapisdefined(isomap, diff, &k), res[i]++), next(1)))); res} \\ David A. Corneth, Aug 05 2018

Extensions

Name changed, extended data by David A. Corneth, Aug 05 2018