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: Walter Carlini

Walter Carlini's wiki page.

Walter Carlini has authored 18 sequences. Here are the ten most recent ones:

A346150 Alternating runs of primes and composites, with the runs of primes being of composite length and the runs of composites being of prime length.

Original entry on oeis.org

2, 4, 6, 3, 5, 7, 11, 8, 9, 10, 13, 17, 19, 23, 29, 31, 12, 14, 15, 16, 18, 37, 41, 43, 47, 53, 59, 61, 67, 20, 21, 22, 24, 25, 26, 27, 71, 73, 79, 83, 89, 97, 101, 103, 107, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42
Offset: 1

Author

Walter Carlini, Jul 07 2021

Keywords

Comments

In other words, use sequence A073846 to list alternating runs of primes and composites, with the number of elements in each run given by successive terms in A073846 - with each even-indexed term of A073846 (being itself prime) denoting the length of each run of composites and each odd-indexed term of A073846 (being itself composite) denoting the length of each run of primes.

Examples

			a(1) = 2, this being a length 1 (1 is initial index) run of primes.
a(2) = 4 & a(3) = 6, 4 and 6 being a length 2 (2 is first prime) run of composites.
a(4) = 3, a(5) = 5, a(6) = 7, and a(7) = 11 being a length 4 (4 is first composite) run of primes.
a(8) = 8, a(9) = 9, and a(10) = 10, being a length 3 (3 is 2nd prime) run of composites.
		

Crossrefs

Cf. A000040 (primes), A002808 (composites), A073846.

Programs

  • Mathematica
    m=10;c1=Select[Range@m,!PrimeQ@#&];p1=Prime@Range@Total@c1;p2=Prime@Range@m;c2=Select[Range[2,2Total@p2],!PrimeQ@#&][[;;Total@p2]];t1=TakeList[p1,c1];t2=TakeList[c2,p2];min=Min[Length/@{t1,t2}];Flatten@Riffle[t1[[;;min]],t2[[;;min]]] (* Giorgos Kalogeropoulos, Jul 30 2021 *)

A277186 Sum of primes within 2n-wide closed interval centered upon prime(n).

Original entry on oeis.org

5, 10, 17, 26, 31, 67, 83, 83, 119, 139, 161, 228, 281, 281, 341, 408, 474, 553, 546, 635, 635, 780, 824, 1092, 954, 1008, 1008, 1139, 1197, 1336, 1621, 1687, 1650, 1823, 1854, 1854, 2238, 2634, 2507, 2587, 2450, 2673, 3223, 3223, 3403, 3403, 3591, 4054, 4054, 4331, 4535, 4535, 4828, 4444, 4666
Offset: 1

Author

Walter Carlini, Oct 04 2016

Keywords

Comments

a(n) is the sum of primes within the closed interval [prime(n)-n, prime(n)+n], where prime(n) is the n-th prime.

Examples

			a(3) = 2 + 3 + 5 + 7 = 17; starting at prime(3) = 5, subtract 3 and add 3 to obtain the interval 2 through 8, and then add up the primes within that interval, inclusive of the endpoints of the interval.
		

Crossrefs

Programs

  • Mathematica
    Table[Total@ Select[Range[Prime@ n - n, Prime@ n + n], PrimeQ], {n, 55}] (* Michael De Vlieger, Oct 04 2016 *)
  • PARI
    a(n) = sum(k=prime(n)-n, prime(n)+n, isprime(k)*k); \\ Michel Marcus, Nov 01 2016

Extensions

More terms from Michael De Vlieger, Oct 04 2016

A277005 Least prime greater than n-th compositorial.

Original entry on oeis.org

2, 5, 29, 193, 1733, 17291, 207367, 2903041, 43545611, 696729629, 12541132817, 250822656001, 5267275776047, 115880067072017, 2781121609728037, 69528040243200079, 1807729046323200001, 48808684250726400031, 1366643159020339200397
Offset: 0

Author

Walter Carlini, Sep 25 2016

Keywords

Examples

			a(0) = A151800(A036691(0)) = A151800(1) = 2; where the zeroth compositorial, A036691(0), is the empty product = 1.
a(3) = 193, which is the least prime number greater than the third compositorial number, 192 = 4 * 6 * 8.
		

Crossrefs

Programs

  • Mathematica
    findComp[n_] := FixedPoint[n + PrimePi@ # + 1 &, n + PrimePi@ n + 1] ; Table[NextPrime@ Product[findComp@ k, {k, n}], {n, 0, 18}] (* Michael De Vlieger, Sep 25 2016, after Robert G. Wilson v at A036691 *)

Formula

a(n) = A151800(A036691(n)). - Michel Marcus, Sep 25 2016

Extensions

a(18) corrected by Sean A. Irvine, Sep 26 2023

A255383 Compositorial mod sum-of-composites.

Original entry on oeis.org

0, 4, 12, 0, 1, 41, 0, 72, 2, 0, 48, 126, 0, 20, 0, 0, 90, 95, 115, 4, 0, 140, 161, 90, 261, 138, 208, 512, 72, 420, 51, 0, 0, 924, 899, 29, 893, 72, 840, 727, 129, 1185, 194, 732, 1080, 1612, 566, 175, 1352, 1192, 1204, 1360, 428, 957, 2170, 0, 0, 513, 2240
Offset: 1

Author

Walter Carlini, May 14 2015

Keywords

Examples

			For n = 5, a(5) = (4*6*8*9*10) mod (4+6+8+9+10) = 17280 mod 37 = 1.
		

Crossrefs

Programs

  • Mathematica
    comp=Select[Range[2,83],!PrimeQ[#]&];Mod[Rest[FoldList[Times,1,comp]],Accumulate[comp]] (* Ivan N. Ianakiev, May 22 2015 *)

Formula

a(n) = A036691(n) mod A053767(n).

Extensions

More terms from Alois P. Heinz, May 21 2015

A255217 Primorial mod sum-of-primes.

Original entry on oeis.org

0, 1, 0, 6, 14, 18, 52, 0, 70, 90, 50, 98, 0, 148, 82, 150, 110, 453, 450, 213, 262, 637, 0, 69, 530, 129, 1106, 339, 1110, 1416, 1290, 1443, 994, 30, 2274, 933, 646, 0, 0, 168, 0, 3234, 0, 786, 2014, 3270, 1680, 0, 1222, 0, 1070, 690, 0, 2934, 416, 0, 0, 0, 708
Offset: 1

Author

Walter Carlini, Apr 25 2015

Keywords

Comments

Does 0 appear infinitely often in this sequence? See A051838.

Examples

			For n = 4, a(4) = (2*3*5*7) mod (2+3+5+7) = 210 mod 17 = 6.
		

Crossrefs

Cf. A002110 (Primorial numbers), A007504 (Sum of first n primes)

Programs

  • Mathematica
    Table[Mod[Product[Prime[i],{i,n}],Sum[Prime[i],{i,n}]],{n,60}] (* Ivan N. Ianakiev, Apr 25 2015 *)
    With[{pr=Prime[Range[60]]},Mod[#[[1]],#[[2]]]&/@Thread[{FoldList[ Times, pr], Accumulate[pr]}]] (* Harvey P. Dale, Jan 22 2016 *)
  • PARI
    a(n) = my(vp=primes(n)); vecprod(vp) % vecsum(vp); \\ Michel Marcus, Dec 05 2021
    
  • PARI
    lista(nn) = {my(s=0, p=1); forprime(q=2, nn, s += q; p *= q; print1(p%s, ", "););} \\ Michel Marcus, Dec 05 2021

Formula

a(n) = prime(n)# mod A007504(n).

Extensions

More terms from Michel Marcus, Apr 25 2015

A153284 a(n) = n + Sum_{j=1..n-1} (-1)^j * a(j) for n >= 2, a(1) = 1.

Original entry on oeis.org

1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1
Offset: 1

Author

Walter Carlini, Dec 23 2008

Keywords

Comments

Row sums of triangle A153860. - Gary W. Adamson, Jan 03 2009
1 followed by interleaving of A000012 and A010701. - Klaus Brockhaus, Jan 04 2009

Examples

			a(1)=1, a(2)=2-a(1)=2-1=1, a(3)=3+a(2)-a(1)=3+1-1=3, a(4)=4-a(3)+a(2)-a(1)=4-3+1-1=1, a(5)=5+1-3+1-1=3, a(6)=6-3+1-3+1-1=1, a(7)=7+1-3+1-3+1-1, etc.
		

Crossrefs

Equals A010684 with the addition of the leading term of 1
The first sequence of a family that includes A153285 and A153286
Cf. A153860.
Cf. A000012 (all 1's sequence), A010701 (all 3's sequence). - Klaus Brockhaus, Jan 04 2009

Programs

  • Magma
    S:=[ 1 ]; for n in [2..105] do Append(~S, n + &+[ (-1)^j*S[j]: j in [1..n-1] ]); end for; S; // Klaus Brockhaus, Jan 04 2009

Formula

a(n)=1 if n is 1 or even; a(n)=3 if n is odd other than 1.
G.f.: x*(1 + x + 2*x^2)/((1+x)*(1-x)). - Klaus Brockhaus, Jan 04 2009 and Oct 15 2009

A153285 a(1)=1; for n > 1, a(n) = n^2 + Sum_{j=1..n-1} (-1)^j*a(j).

Original entry on oeis.org

1, 3, 11, 7, 23, 11, 35, 15, 47, 19, 59, 23, 71, 27, 83, 31, 95, 35, 107, 39, 119, 43, 131, 47, 143, 51, 155, 55, 167, 59, 179, 63, 191, 67, 203, 71, 215, 75, 227, 79, 239, 83, 251, 87, 263, 91, 275, 95, 287, 99, 299, 103, 311, 107, 323, 111, 335, 115, 347, 119, 359
Offset: 1

Author

Walter Carlini, Dec 23 2008

Keywords

Comments

1 followed by interleaving of A004767 and A017653. - Klaus Brockhaus, Jan 04 2009

Examples

			a(1) = 1;
a(2) = 2^2 - a(1) = 4 - 1 = 3;
a(3) = 3^2 + a(2) - a(1) = 9 + 3 - 1 = 11;
a(4) = 4^2 - 11 + 3 - 1 = 7;
a(5) = 25 + 7 - 11 + 3 - 1 = 23;
a(6) = 36 - 23 + 7 - 11 + 3 - 1 = 11; etc.
		

Crossrefs

The second of a family of sequences that includes A153284 and A153286
Cf. A004767 (4n+3), A017653 (12n+11). - Klaus Brockhaus, Jan 04 2009

Programs

  • Magma
    S:=[ 1 ]; for n in [2..61] do Append(~S, n^2 + &+[ (-1)^j*S[j]: j in [1..n-1] ]); end for; S; // Klaus Brockhaus, Jan 04 2009
    
  • Scheme
    (define (A153285 n) (cond ((= 1 n) n) ((even? n) (+ n n -1)) (else (+ (* 6 n) -7)))) ;; Antti Karttunen, Aug 10 2017

Formula

a(n) = 2n-1 if n is 1 or an even number;
a(n) = 6n-7 if n is an odd number other than 1.
G.f.: x*(1 + 3*x + 9*x^2 + x^3 + 2*x^4)/((1+x)^2*(1-x)^2). - Klaus Brockhaus, Oct 15 2009
a(n) = 4*(n-1) - (2*n-3)*(-1)^n for n>1, a(1)=1. - Bruno Berselli, Sep 14 2011

Extensions

Extended beyond a(30) by Klaus Brockhaus, Jan 04 2009

A153286 a(n) = n^3 + sum((-1)^j*a(j)); for j=1 to n-1; a(1)=1.

Original entry on oeis.org

1, 7, 33, 37, 135, 91, 309, 169, 555, 271, 873, 397, 1263, 547, 1725, 721, 2259, 919, 2865, 1141, 3543, 1387, 4293, 1657, 5115, 1951, 6009, 2269, 6975, 2611, 8013, 2977, 9123, 3367, 10305, 3781, 11559, 4219, 12885, 4681, 14283, 5167, 15753, 5677, 17295
Offset: 1

Author

Walter Carlini, Dec 23 2008, Jan 01 2009

Keywords

Comments

1 followed by interleaving of A154105 and 3*A154106. - Klaus Brockhaus, Jan 04 2009

Examples

			a(1)=1, a(2)=2^3-a(1)=8-1=7, a(3)=3^3+a(2)-a(1)=27+7-1=33, a(4)=64-33+7-1=37, a(5)=125+37-33+7-1=135, a(6)=216-135+37-33+7-1=91, etc.
		

Crossrefs

The third of a family of sequences that includes A153284 and A153285.
Cf. A154105 (12*n^2 + 18*n + 7), A154106 (12*n^2 + 22*n + 11). - Klaus Brockhaus, Jan 04 2009

Programs

  • Magma
    S:=[ 1 ]; for n in [2..45] do Append(~S, n^3 + &+[ (-1)^j*S[j]: j in [1..n-1] ]); end for; S; // Klaus Brockhaus, Jan 04 2009

Formula

G.f.: x*(1 + 7*x + 30*x^2 + 16*x^3 + 39*x^4 + x^5 + 2*x^6)/((1+x)^3*(1-x)^3). - Klaus Brockhaus, Jan 04 2009
From Walter Carlini, Jan 12 2009: (Start)
a(n) = 3n^2 - 3n + 1 if n is 1 or an even number;
a(n) = 9n^2 - 21n + 15 if n is any odd number other than 1. (End)

Extensions

Extended beyond a(30) by Klaus Brockhaus, Jan 04 2009
G.f. corrected by Klaus Brockhaus, Oct 15 2009

A134694 a(0) = 2; a(n) = least prime p such that p >= a(n-1) + 2^n.

Original entry on oeis.org

2, 5, 11, 19, 37, 71, 137, 269, 541, 1061, 2087, 4139, 8237, 16433, 32831, 65599, 131143, 262217, 524369, 1048661, 2097257, 4194409, 8388733, 16777381, 33554639, 67109071, 134217943, 268435697, 536871157, 1073742073, 2147483929
Offset: 0

Author

Walter Carlini, Jan 27 2008

Keywords

Comments

Primes separated by at least successive powers of 2.

Examples

			a(0) = 2 (by definition).
a(1) = 5 because 5 is the least prime >= 4 = 2 + 2^1.
a(2) = 11 because 11 is the least prime >= 9 = 5 + 2^2.
a(3) = 19 because 19 is the least prime >= 19 = 11 + 2^3.
		

Crossrefs

Cf. A000040.

Programs

  • Mathematica
    a = {2}; Do[i = a[[ -1]]+2^n; While[ !PrimeQ[i], i++ ]; AppendTo[a, i], {n,1,50}]; a (* Stefan Steinerberger, Jan 28 2008 *)
    nxt[{n_,a_}]:={n+1,NextPrime[a+2^(n+1)-1]}; NestList[nxt,{0,2},30][[All,2]] (* Harvey P. Dale, Jan 04 2017 *)

Extensions

More terms from Stefan Steinerberger, Jan 28 2008

A119411 Product of the first prime(n) primes.

Original entry on oeis.org

6, 30, 2310, 510510, 200560490130, 304250263527210, 1922760350154212639070, 7858321551080267055879090, 267064515689275851355624017992790, 279734996817854936178276161872067809674997230
Offset: 1

Author

Walter Carlini, Jul 26 2006

Keywords

Examples

			a(1) = p(p(1))# = p(2)# (because p(1) = 2 is the first prime number) = 2* 3 = 6 (by the definition of primorial, see A002110); that is, the product of the first 2 prime numbers.
a(2) = p(p(2))# = p(3)# = 2 * 3 * 5 = 30 = the product of the first 3 primes.
a(3) = 2 * 3 * 5 * 7 * 11 = 2310 = the product of the first 5 primes.
a(4) = 2 * 3 * 5 * 7 * 11 * 13 * 17 = 510510 = product of first 7 primes.
		

References

  • A. Fletcher, J. C. P. Miller, L. Rosenhead and L. J. Comrie, An Index of Mathematical Tables. Vols. 1 and 2, 2nd ed., Blackwell, Oxford and Addison-Wesley, Reading, MA, 1962, Vol. 1, p. 50.

Crossrefs

Cf. A002110.

Programs

  • Mathematica
    Array[Times @@ Array[Prime, Prime@# ] &, 10] (* Robert G. Wilson v, Jul 27 2006 *)

Formula

a(n) = p(p[n])#, where p[n] is the n-th prime number and where p(m)# is the m-th primorial number (Cf. A002110).

Extensions

a(10) from Robert G. Wilson v, Jul 27 2006