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 21-30 of 31 results. Next

A115090 a(n) = A115074(n) - A117183(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 3, 1, 0, 0, 5, 0, 1, 3, 9, 2, 1, 0, 3, 11, 1, 5, 3, 4, 0, 15, 1, 2, 17, 3, 0, 5, 9, 3, 21, 1, 5, 8, 3, 11, 1, 5, 27, 10, 3, 0, 29, 0, 5, 0, 9, 2, 15, 5, 1, 4, 35, 3, 17, 14, 11, 3, 1, 39, 5, 0, 16, 41, 2, 9, 3, 21, 45, 4, 1, 5, 9, 3, 15, 20, 11, 51, 1, 9, 5, 2, 17, 27, 11, 57, 3, 9, 0
Offset: 1

Views

Author

Leroy Quet, Mar 01 2006

Keywords

Comments

The union of A115090 is the complement of A007921: numbers that are not the difference of two primes. - Robert G. Wilson v, Mar 09 2006

Examples

			12, the 4th nonsquarefree positive integer, is 2^2 * 3. 3 is the largest prime dividing 12. 2 is the smallest prime dividing 12. So a(4) = 3 - 2 = 1.
		

Crossrefs

Programs

  • Mathematica
    (Max@# - Min@#) & /@ (First /@ FactorInteger@# & /@ Select[ Range@243, !SquareFreeQ@# &]) (* Robert G. Wilson v, Mar 09 2006 *)

Formula

a(n) = A046665(A013929(n)). - Amiram Eldar, Jan 06 2024

Extensions

More terms from Robert G. Wilson v, Mar 09 2006

A376520 Position of first appearance of 2n in the run-compression (A037201) of the first differences (A001223) of the prime numbers (A000040).

Original entry on oeis.org

2, 3, 8, 22, 32, 42, 28, 259, 91, 141, 172, 242, 341, 400, 556, 692, 198, 1119, 3126, 2072, 1779, 1737, 7596, 2913, 3246, 2101, 3598, 7651, 4383, 4294, 3457, 8284, 14220, 11986, 15101, 3204, 32808, 18217, 16273, 42990, 22303, 37037, 13729, 43117, 32820, 70501
Offset: 1

Views

Author

Gus Wiseman, Sep 26 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime numbers (A000040) is:
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, ...
with first differences (A001223):
  1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, ...
with run-compression (A037201):
  1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, ...
with first appearance of 2n at (A376520):
  2, 3, 8, 22, 32, 42, 28, 259, 91, 141, 172, 242, 341, 400, 556, 692, 198, 1119, ...
		

Crossrefs

This is the position of first appearance of 2n in A037201.
For positions of twos instead of first appearances we have A376343.
The sorted version is A376521.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259 (ones A375927).
A013929 lists nonsquarefree numbers, differences A078147.
A116861 counts partitions by compressed sum, compositions A373949.
A116608 counts partitions by compressed length, compositions A333755.
A274174 counts contiguous compositions, ranks A374249.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.

Programs

  • Mathematica
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=First/@Split[Differences[Select[Range[10000],PrimeQ]]];
    Table[Position[q,2k][[1,1]],{k,mnrm[Rest[q]/2]}]

A110673 Numbers that are neither the sum nor the difference of two primes.

Original entry on oeis.org

23, 37, 47, 53, 67, 79, 83, 89, 93, 97, 113, 117, 119, 121, 123, 127, 131, 143, 145, 157, 163, 167, 173, 185, 187, 203, 205, 207, 211, 215, 217, 219, 223, 233, 245, 247, 251, 257, 263, 277, 287, 289, 293, 297, 299, 301, 303, 307, 317, 321, 323, 325, 327, 331
Offset: 1

Views

Author

Eric Angelini, Sep 14 2005

Keywords

Comments

The sequence is obtained by interleaving A099019 and A134797. From Goldbach's conjecture, apparently all terms are odd. - Bob Selcoe, Mar 10 2015
Intersection of A007921 and A014092. - Michel Marcus, Mar 16 2015

Crossrefs

Cf. A007921 (not the difference), A014092 (not the sum).
Cf. also A099019, A134797.

Programs

  • Mathematica
    Lim=331; nn=PrimePi[Lim+1]; (* Lim is upper limit of sequence; nn is range of primes to consider *)
    dif=Union[Flatten[Differences/@Subsets[Prime[Range[nn]],{2}]]]; (* differences of two primes *)
    sum=Union[Join[Flatten[Total/@Subsets[Prime[Range[nn]],{2}]],Table[2*Prime[n], {n, nn}]]];seq2; (* sums of two primes *)
    Complement[Range[Lim],dif,sum] (* neither sum nor difference *) (* James C. McMahon, Jun 10 2024 *)

Extensions

Corrected and extended by Joshua Zucker, May 04 2006
Offset corrected by Arkadiusz Wesolowski, May 19 2012

A122170 Number of primes p <= 2n such that p+n is also a prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 0, 3, 1, 4, 1, 5, 0, 4, 1, 4, 1, 6, 0, 4, 1, 4, 0, 10, 0, 6, 1, 5, 1, 12, 0, 5, 0, 6, 1, 13, 0, 7, 1, 9, 1, 13, 0, 7, 1, 6, 0, 13, 0, 9, 1, 7, 0, 14, 0, 12, 1, 7, 1, 19, 0, 7, 0, 10, 1, 20, 0, 11, 1, 13, 1, 15, 0, 8, 0, 10, 1, 18, 0, 12, 1, 8, 0, 23, 0, 10, 1, 10, 0, 26, 0, 13, 0, 13
Offset: 1

Views

Author

Lekraj Beedassy, Aug 23 2006

Keywords

Comments

a(n)=0 for n in A007921.

Examples

			a(12)=5 because only the 5 primes p=5,7,11,17,19 below 24 form other primes p+12 = 17,19,23,29,31.
		

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..3000,2)]);
    f:= proc(n) local m,R;
      m:= ListTools:-BinaryPlace(P,3*n);
      R:= convert(P[1..m],set);
      nops((R -~ n) intersect R)
    end proc:
    f(1):= 1:
    map(f, [$1..1000]); # Robert Israel, Mar 22 2023
  • Mathematica
    Table[Length[Select[Select[Range[2*n], PrimeQ], PrimeQ[ #+n]&]], {n, 100}] (* Ryan Propper, Nov 12 2006 *)

Extensions

More terms from Ryan Propper, Nov 12 2006

A191837 Least even number m which can be written as sum of 2n primes p(1) < ... < p(2n) < m/2 such that m-p(i) is also prime for i=1,...,2n.

Original entry on oeis.org

48, 108, 204, 324, 624, 630, 1050, 1320, 1590, 2100, 2400, 2730, 3570, 3960, 4830, 5460, 5880, 6930, 7770, 9240, 9450, 11970, 12810, 13020, 14910, 14910, 17430, 18480, 20160, 21630, 23100, 24150, 28770, 28770, 31290, 32760, 32760, 36960, 36960, 39270, 39270, 50190, 51870, 51870
Offset: 2

Views

Author

J. M. Bergot, Jun 17 2011

Keywords

Comments

Original definition: In the Goldbach partitions of 2n, find the first 2n with four prime elements to sum to it; find the first 2n with six elements summing to 2n; and so for 2k elements.
Whenever there is more than one decomposition of m as sum of primes, it must be odd+odd=even. Then, only an even number of (odd prime) summands can yield m. Moreover, we restrict these summands to be the lesser one of the decompositions p+q=m, therefore we need more than 2 such summands to yield m, and a(1) is undefined.
The integers in this sequence are all congruent to 0 mod 6.
There can be more than one composition of m. E.g., for m=48, 48=5+7+17+19 and 48=7+11+13+17.
Conjecture: For all a(n), a(n)-1 can be found in A014092 (numbers not the sum of two primes), and a(n)+1 can be found in A007921. (numbers not the difference of two primes). - J. Stauduhar, Aug 28 2012
From J. Stauduhar, Aug 22 2011: (Start)
All a(n) are congruent to 0 mod 6=2*3.
All a(n) >= a(7)=630 are congruent to 0 mod 30=2*3*5.
All a(n) >= a(16)=4830 are congruent to 0 mod 210=2*3*5*7.
All a(n) >= a(279)=3513510 are congruent to 0 mod 2310=2*3*5*7*11.
All a(n) >= a(1440)=137507370 are congruent to 0 mod 30030=2*3*5*7*11*13. (End)

Examples

			For 48, we have 48=5+43=7+41=17+31=19+29 (ignoring 11+37), and use 5+7+17+19 to give the first even number having four such primes summing to itself.
Similarly, 108 is the least even number with six prime elements summing to itself: 5+103=7+101=11+97=19+89=29+79=37+71 and taking 5+7+11+19+29+37=108.
a(2) = 48 = 5+7+17+19 = 7+11+13+17
a(3) = 108 = 5+7+11+19+29+37
a(9) = 1320 = 13+17+19+23+29+31+37+41+43+61+71+83+89+97+103+107+149+307
		

Programs

  • Mathematica
    nCk[a_, b_]:=Block[{ndx=ns= a, i=rs=b, ct=t=0}, If[(d[[1]]-1)==(ns-rs), For[ct=1, ct<=rs, ct++, t+=s[[d[[ct]]]]]; If[t==m, Print[sm/2, " ", t]; sm+=2; m-=6; Return[False], Return[False]]]; While[d[[i]]==ndx && i>1, --i; --ndx]; d[[i]]+=1; i++; While[i<=rs, d[[i]]=d[[i-1]]+1; ++i;]; For[ct=1, ct<=rs, ct++, t+=s[[d[[ct]]]]; If[t>m, Break[]]]; If[t==m, Print[sm/2, " ", t]; sm+=2; m-=6; Return[False]]; Return[True]]; For[sm=4; m=6, sm<=60, m+=6, s={}; sum=smndct=pct=0; For[p=5, pm, Break[]]; If[smndct++= sm, d=Range[sm]; While[nCk[Length[s], sm]]]]; (* J. Stauduhar, Sep 07 2012*)
  • PARI
    a(n)=forstep(m=2,1e9,2,L=[]; forprime(p=1,m\2-1,isprime(m-p)||next;L=concat(L,p)); #L<2*n&next; sum(i=#L-2*n+1,#L,L[i])
    				

Extensions

a(4)-a(5) from M. F. Hasler, Jun 21 2011
a(2) to a(5) verified; a(6) to a(10) added by S Kolman, Jul 03 2011
a(11) to a(13) added by S Kolman, Jul 04 2011
a(14) to a(14) added by S Kolman, Jul 05 2011
Confirmed a(7). a(6) corrected by J. Stauduhar, Jul 08 2011
Corrected a(8)-a(14) and extended to a(2500). - J. Stauduhar, Jul 12 2011
Edited by J. Stauduhar, Aug 28 2012

A308833 Numbers r such that the r-th tetrahedral number A000292(r) divides r!.

Original entry on oeis.org

1, 7, 8, 13, 14, 19, 20, 23, 24, 25, 26, 31, 32, 33, 34, 37, 38, 43, 44, 47, 48, 49, 50, 53, 54, 55, 56, 61, 62, 63, 64, 67, 68, 73, 74, 75, 76, 79, 80, 83, 84, 85, 86, 89, 90, 91, 92, 93, 94, 97, 98, 103, 104, 109, 110, 113, 114, 115, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Keywords

Comments

Conjecture: for every odd integer r > 1, the following statements are equivalent: a) r is a term of this sequence, b) r + 1 is a term of this sequence, c) r + 2 is composite.

Examples

			The 7th tetrahedral number is 84, and 84*60 = 5040 = 7!.
		

Crossrefs

Cf. A000142 (factorial numbers), A000292 (tetrahedral numbers).
Cf. A007921 (numbers which are not difference of two primes), A153238.

Programs

  • Maple
    q := n -> (irem(n!, n*(n+1)*(n+2)/6) = 0):
    select(q, [$1..120])[];
  • Mathematica
    Select[Range@ 120, Mod[#!, Pochhammer[#, 3]/6] == 0 &] (* Michael De Vlieger, Jul 08 2019 *)
  • PARI
    isok(k) = !(k! % (k*(k+1)*(k+2)/6)); \\ Michel Marcus, Jun 28 2019
    
  • PARI
    is(n) = { my(f = factor(binomial(n + 2, 3))); forstep(i = #f~, 1, -1, if(val(n, f[i, 1]) - f[i, 2] < 0, return(0) ) ); 1 }
    val(n, p) = my(r=0); while(n, r+=n\=p);r \\ David A. Corneth, Mar 22 2021

A124658 Even numbers k such that if a person is born in year k and lives not more than 100 years, then he never celebrates his prime birthday on a prime year.

Original entry on oeis.org

5246, 5888, 7702, 7954, 9952, 9974, 10342, 10532, 11986, 12176, 12688, 13528, 14968, 15178, 15832, 16766, 18692, 18748, 18804, 19106, 20822, 21928, 22486, 22826, 22886, 24260, 24272, 24596, 24868, 25678, 25708, 26966, 27134, 27146
Offset: 1

Views

Author

Tanya Khovanova, Dec 22 2006

Keywords

Comments

For odd years, if a man is born on an odd year, his not being able to celebrate his prime birthday on a prime year is equivalent to the year of birth being an odd composite minus 2: A007921 Numbers that are not the difference of two primes.

Crossrefs

Cf. A007921.

A176406 Odd semiprimes minus 2.

Original entry on oeis.org

7, 13, 19, 23, 31, 33, 37, 47, 49, 53, 55, 63, 67, 75, 83, 85, 89, 91, 93, 109, 113, 117, 119, 121, 127, 131, 139, 141, 143, 153, 157, 159, 167, 175, 181, 183, 185, 199, 201, 203, 207, 211, 213, 215, 217, 219, 233, 235, 245, 247, 251, 257, 263, 265, 285, 287
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 16 2010

Keywords

Crossrefs

Cf. A007921.

Programs

  • Maple
    isA001358 := proc(n) numtheory[bigomega](n) = 2 ; end proc: for n from 1 to 400 by 2 do if isA001358(n+2) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Apr 20 2010
  • Mathematica
    Select[Range[9,301,2],PrimeOmega[#]==2&]-2 (* Harvey P. Dale, May 11 2018 *)

Formula

a(n) = A046315(n) - 2.

Extensions

Entries checked by R. J. Mathar, Apr 20 2010

A176568 Nonnegative nonprimes which are neither the difference, nor the sum, nor the product of two distinct primes.

Original entry on oeis.org

0, 117, 121, 207, 245, 289, 297, 325, 343, 363, 405, 425, 475, 483, 495, 513, 529, 531, 625, 627, 637, 665, 705, 715, 747, 765, 777, 783, 801, 805, 833, 845, 847, 867, 873, 891, 897, 903, 915, 925, 957, 961, 963, 987, 1001, 1005, 1025, 1045, 1075, 1083, 1113, 1143, 1175, 1197, 1209, 1245, 1265
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 20 2010

Keywords

Crossrefs

Formula

A171469 INTERSECT A007921. [R. J. Mathar, May 02 2010]

Extensions

Corrected definition and values (inserted 289, 343 ...) - R. J. Mathar, May 02 2010

A215081 Smallest number k such that the difference between the greatest prime divisor and the smallest prime divisor of k equals n, or 0 if there is no such k.

Original entry on oeis.org

2, 6, 15, 10, 21, 14, 55, 0, 33, 22, 39, 26, 85, 0, 51, 34, 57, 38, 115, 0, 69, 46, 203, 0, 145, 0, 87, 58, 93, 62, 259, 0, 185, 0, 111, 74, 205, 0, 123, 82, 129, 86, 235, 0, 141, 94, 371, 0, 265, 0, 159, 106, 413, 0, 295, 0, 177, 118, 183, 122, 469, 0, 335, 0
Offset: 0

Views

Author

Michel Lagneau, Aug 02 2012

Keywords

Comments

a(A007921(n)) = 0 where A007921(n) are the numbers that are not the difference of two primes.

Examples

			a(2) = 15 because 15 = 3*5 and 5 - 3 = 2.
		

Crossrefs

Cf. A007921.

Programs

  • Maple
    with(numtheory):for n from 0 to 65 do:ii:=0:for k from 2 to 10000 while(ii=0) do:x:=factorset(k):n1:=nops(x):d:=x[n1] - x[1]:if d=n then ii:=1: printf("%a, ", k):else fi:od:if ii=0 then printf("%a, ", 0):else fi:od:
Previous Showing 21-30 of 31 results. Next