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 11-20 of 98 results. Next

A373406 Sum of the n-th maximal run of odd primes differing by two.

Original entry on oeis.org

15, 24, 36, 23, 60, 37, 84, 47, 53, 120, 67, 144, 79, 83, 89, 97, 204, 216, 113, 127, 131, 276, 300, 157, 163, 167, 173, 360, 384, 396, 211, 223, 456, 233, 480, 251, 257, 263, 540, 277, 564, 293, 307, 624, 317, 331, 337, 696, 353, 359, 367, 373, 379, 383
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The length of this run is given by A251092.
For this sequence we define a run to be an interval of positions at which consecutive terms differ by two. Normally, a run has consecutive terms differing by one, but odd prime numbers already differ by at least two.
Contains A054735 (sums of twin prime pairs) without its first two terms and A007510 (non-twin primes) as subsequences. - R. J. Mathar, Jun 07 2024

Examples

			Row-sums of:
   3   5   7
  11  13
  17  19
  23
  29  31
  37
  41  43
  47
  53
  59  61
  67
  71  73
  79
  83
  89
  97
		

Crossrefs

The partial sums are a subset of A071148 (partial sums of odd primes).
Functional neighbors: A025584, A054265, A067774, A251092 (or A175632), A373405, A373413, A373414.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Total/@Split[Select[Range[3,100],PrimeQ],#1+2==#2&]//Most

A132235 Primes congruent to 23 (mod 30).

Original entry on oeis.org

23, 53, 83, 113, 173, 233, 263, 293, 353, 383, 443, 503, 563, 593, 653, 683, 743, 773, 863, 953, 983, 1013, 1103, 1163, 1193, 1223, 1283, 1373, 1433, 1493, 1523, 1553, 1583, 1613, 1733, 1823, 1913, 1973, 2003, 2063, 2153, 2213, 2243, 2273, 2333, 2393
Offset: 1

Views

Author

Omar E. Pol, Aug 15 2007

Keywords

Comments

Primes (excluding 3) ending in 3 with (SOD-1)/3 non-integer where SOD is sum of digits. - Ki Punches
The sequence is infinite by Dirichlet's theorem. - Arkadiusz Wesolowski, Apr 02 2014
Terms are non-twin primes A007510. - Omar E. Pol, Jul 25 2019

Crossrefs

Programs

Formula

a(n) = A158791(n)*30 + 23. - Ray Chandler, Apr 07 2009
Intersection of A030431 and A007528. - Ray Chandler, Apr 07 2009

Extensions

Extended by Ray Chandler, Apr 07 2009

A113688 Isolated semiprimes in the semiprime square spiral.

Original entry on oeis.org

65, 74, 249, 295, 309, 355, 422, 511, 545, 667, 669, 758, 926, 943, 979, 998, 1099, 1167, 1186, 1322, 1457, 1469, 1561, 1585, 1658, 1711, 1774, 1779, 1835, 1891, 1959, 1961, 1963, 2021, 2038, 2066, 2155, 2186, 2191, 2206, 2271, 2329, 2342
Offset: 1

Views

Author

Jonathan Vos Post, Nov 05 2005

Keywords

Comments

Write the integers 1, 2, 3, 4, ... in a counterclockwise square spiral. Analogous to Ulam's marking the primes in the spiral and discovering unexpectedly many connected diagonals, we construct a semiprime spiral by marking the semiprimes (A001358). Each integer has 8 adjacent integers in the spiral, horizontally, vertically and diagonally. Curious extended clumps coagulate, slightly denser towards the origin, of semiprimes connected by adjacency. This sequence lists the isolated semiprimes in the semiprime spiral, namely those semiprimes none of whose adjacent integers in the spiral are semiprimes. A113689 gives an enumeration of the number of semiprimes in clumps of size > 1 through n^2.
The squares of twin primes occupy adjacent points along the southeast diagonal, so none are isolated. Thus the only isolated semiprimes in the spiral that are squares are the squares of "isolated primes" (A007510). The first square in this sequence is a(1473) = 66049 = 257^2. - Jon E. Schoenfield, Aug 12 2018

Examples

			Spiral example:
.
  17--16--15--14--13
   |               |
  18   5---4---3  12
   |   |       |   |
  19   6   1---2  11
   |   |           |
  20   7---8---9--10
   |
  21--22--23--24--25
.
From _Michael De Vlieger_, Dec 22 2015: (Start)
Spiral including n <= 121 showing only semiprimes; the isolated semiprimes appear in parentheses:
.
    .---.---.---.---.---.--95--94--93---.--91
    |                                       |
    . (65)--.---.--62---.---.---.--58--57   .
    |   |                               |   |
    .   .   .---.--35--34--33---.---.   .   .
    |   |   |                       |   |   |
    .   .  38   .---.--15--14---.   .  55   .
    |   |   |   |               |   |   |   |
    .   .  39   .   .---4---.   .   .   .  87
    |   |   |   |   |       |   |   |   |   |
  106  69   .   .   6   .---.   .   .   .  86
    |   |   |   |   |           |   |   |   |
    .   .   .   .   .---.---9--10   .   .  85
    |   |   |   |                   |   |   |
    .   .   .  21--22---.---.--25--26  51   .
    |   |   |                           |   |
    .   .   .---.---.--46---.---.--49---.   .
    |   |                                   |
    .   .-(74)--.---.--77---.---.---.---.--82
    |
  111---.---.---.-115---.---.-118-119---.-121
.
(End)
		

References

  • S. M. Ellerstein, The square spiral, J. Recreational Mathematics 29 (#3, 1998) 188; 30 (#4, 1999-2000), 246-250.

Crossrefs

Cf. A115258 (isolated primes in Ulam's lattice).

Programs

  • Mathematica
    spiral[n_] := Block[{o = 2 n - 1, t, w}, t = Table[0, {o}, {o}]; t = ReplacePart[t, {n, n} -> 1]; Do[w = Partition[Range[(2 (# - 1) - 1)^2 + 1, (2 # - 1)^2], 2 (# - 1)] &@ k; Do[t = ReplacePart[t, {(n + k) - (j + 1), n + (k - 1)} -> #[[1, j]]]; t = ReplacePart[t, {n - (k - 1), (n + k) - (j + 1)} -> #[[2, j]]]; t = ReplacePart[t, {(n - k) + (j + 1), n - (k - 1)} -> #[[3, j]]]; t = ReplacePart[t, {n + (k - 1), (n - k) + (j + 1)} -> #[[4, j]]], {j, 2 (k - 1)}] &@ w, {k, 2, n}]; t]; f[w_] := Block[{d = Dimensions@ w, t, g}, t = Reap[Do[Sow@ Take[#[[k]], {2, First@ d - 1}], {k, 2, Last@ d - 1}]][[-1, 1]] &@ w; g[n_] := If[n != 0, Total@ Join[Take[w[[Last@ # - 1]], {First@ # - 1, First@ # + 1}], {First@ #, Last@ #} &@ Take[w[[Last@ #]], {First@ # - 1, First@ # + 1}], Take[w[[Last@ # + 1]], {First@ # - 1, First@# + 1}]] &@(Reverse@ First@ Position[t, n] + {1, 1}) == 0, False]; Select[Union@ Flatten@ t, g@ # &]]; t = spiral@ 26 /. n_ /; PrimeOmega@ n != 2 -> 0; f@ t (* Michael De Vlieger, Dec 21 2015, Version 10 *)

Extensions

Corrected and extended by Alois P. Heinz, Jan 02 2011

A161165 The n-th twin prime plus the n-th isolated prime.

Original entry on oeis.org

5, 28, 44, 58, 66, 84, 98, 112, 120, 138, 156, 186, 192, 228, 236, 268, 276, 318, 332, 370, 390, 406, 414, 456, 474, 498, 510, 528, 536, 580, 588, 606, 614, 648, 654, 670, 680, 712, 722, 786, 792, 868, 878, 898, 912, 948, 954, 1020, 1026, 1078, 1112, 1146, 1158, 1180
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 04 2009

Keywords

Examples

			a(1) = 3 +  2 =  5;
a(2) = 5 + 23 = 28;
a(3) = 7 + 37 = 44.
		

Crossrefs

Programs

  • Maple
    isA001097 := proc(n) isprime(n) and (isprime(n+2) or isprime(n-2)) ; end proc:
    A001097 := proc(n) if n = 1 then 3; else for p from procname(n-1)+2 by 2 do if isA001097(p) then return p end if; end do: end if; end proc:
    isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; end proc:
    A007510 := proc(n) if n = 1 then 2; else for p from procname(n-1)+1 do if isA007510(p) then return p end if; end do: end if; end proc:
    A161165 := proc(n) A001097(n) + A007510(n) ; end proc:
    seq(A161165(n),n=1..100) ; # R. J. Mathar, Mar 18 2010
    # alternate program
    isA001097 := proc(n) if isprime(n) then isprime(n+2) or isprime(n-2) ; else false; end if; end proc:
    isA007510 := proc(n) if isprime(n) then not isprime(n+2) and not isprime(n-2) ; else false; end if; end proc:
    A001097 := proc(n) option remember; if n = 1 then 3; else for a from procname(n-1)+1 do if isA001097(a) then return a; end if; end do: end if; end proc:
    A007510 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA007510(a) then return a; end if; end do: end if; end proc:
    A161165 := proc(n) A001097(n)+A007510(n) ; end proc: seq(A161165(n),n=1..90) ; # R. J. Mathar, Mar 29 2010

Formula

a(n) = A001097(n) + A007510(n).

Extensions

Entries checked by R. J. Mathar, Mar 18 2010

A060330 Primes that are the sum of five consecutive composite numbers.

Original entry on oeis.org

37, 53, 67, 83, 97, 157, 293, 307, 353, 367, 503, 547, 683, 743, 757, 907, 953, 967, 983, 997, 1193, 1553, 1567, 1733, 1747, 2153, 2617, 2843, 2857, 3083, 3203, 3217, 3307, 4057, 4133, 4283, 4297, 5107, 5153, 5167, 5303, 6143, 6397, 6607, 7253, 7417
Offset: 1

Views

Author

Robert G. Wilson v, Mar 30 2001

Keywords

Comments

Conjecture: all these primes are isolated primes (A007510). - Davide Rotondo, Dec 31 2024
Stronger conjecture: all p are 7 or 23 mod 30. - Charles R Greathouse IV, Jan 21 2025
Above conjectures are true. Proof sketch: n + n+1 + n+2 + n+3 + n+4 = 5n+10, so there must be at least one prime sandwiched between the five composite numbers. If p and p+4 are prime, then p-1 + p+1 + p+2 + p+3 + p+5 = 5p + 10 is composite. If neither p-2 nor p+2 are prime, the sums p-4 + p-3 + p-2 + p-1 + p+1, etc., are 5p-9, 5p-3, 5p+3, and 5p+9 which are even for p > 2 (and p = 2 does not work). So we must have p and p+2 prime, which yield p-3 + p-2 + p-1 + p+1 + p+3 = 5p-2, p-2 + p-1 + p+1 + p+3 + p+4 = 5p+5, and p-1 + p+1 + p+3 + p+4 + p+5 = 5p+12. 5p+5 is composite, but the others can work. Now note that the first form yields only 5p-2 = 23 mod 30 and the second 5p+12 = 7 mod 30. - Charles R Greathouse IV, Jan 23 2025

Crossrefs

Subsequence of A007510.

Programs

  • Mathematica
    composite[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1 != n, k++ ]; k); a = {}; Do[ p = composite[ n ] + composite[ n + 1 ] + composite[ n + 2 ] + composite[ n + 3 ] + composite[ n + 4 ]; If[ PrimeQ[ p ], a = Append[ a, p ] ], {n, 1, 1500} ]; a
  • PARI
    list(lim)=my(v=List(), u=[4, 6, 8, 9, 0], i=5); forcomposite(n=10, lim\1, u[i]=n; if(i++>5, i=1); my(p=vecsum(u)); if(p>lim, break); if(isprime(p), listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Dec 27 2024
    
  • PARI
    ok(p)=p=p%30; p==11 || p==17 || p==29
    list(lim)=my(v=List([37]),p=11); forprime(q=13, (lim+12)\5, if(q-p>2 || !ok(p), p=q; next); if(isprime(5*p-2), listput(v,5*p-2)); if(isprime(5*p+12), listput(v,5*p+12)); p=q); if(v[#v]>lim, listpop(v)); Vec(v) \\ Charles R Greathouse IV, Jan 23 2025

Formula

a(n) >> n log^3 n. - Charles R Greathouse IV, Jan 23 2025

A072026 Swap twin prime pairs >(3,5) in prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 14, 13, 12, 11, 10, 21, 16, 19, 18, 17, 28, 15, 26, 23, 24, 49, 22, 27, 20, 31, 42, 29, 32, 39, 38, 35, 36, 37, 34, 33, 56, 43, 30, 41, 52, 63, 46, 47, 48, 25, 98, 57, 44, 53, 54, 91, 40, 51, 62, 61, 84, 59, 58, 45, 64, 77, 78
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(143)=a(11*13)=a(11)*a(13)=13*11=143; a(77)=a(7*11)=a(7)*a(11)=5*13=65.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[{p, e} = pe; If[p <= 3, p, If[PrimeQ[p+2], p+2, If[PrimeQ[p-2], p-2, p]]]^e, {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, Nov 20 2021 *)

Formula

a(a(n)) = n, a self-inverse permutation of natural numbers.
a(n) = n for single primes (A007510) and products of twin prime pairs (A037074).
Multiplicative with a(p) = (if p<=3 then p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p, q primes > 3, p = q+2} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 0.53439004468579249988... . - Amiram Eldar, Dec 24 2022

A062729 n not divisible by any prime=p, where either p-2 or p+2 is prime.

Original entry on oeis.org

1, 2, 4, 8, 16, 23, 32, 37, 46, 47, 53, 64, 67, 74, 79, 83, 89, 92, 94, 97, 106, 113, 127, 128, 131, 134, 148, 157, 158, 163, 166, 167, 173, 178, 184, 188, 194, 211, 212, 223, 226, 233, 251, 254, 256, 257, 262, 263, 268, 277, 293, 296
Offset: 1

Views

Author

Leroy Quet, Jul 11 2001

Keywords

Comments

Complement of A062506.
n divisible only by single primes A007510. - Zak Seidov, May 11 2015

Examples

			46 is included because 46 = 2 * 23 and all (2+2), (2-2), (23+2), (23-2) are composite. - edited by _Zak Seidov_, May 11 2015
		

Crossrefs

Cf. A062506, A007510. - Zak Seidov, May 11 2015

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    Primes:= select(isprime, {2,(2*i+1)$i=1..ceil((N+1)/2)}):
    LTwins:= Primes intersect map(`-`,Primes,2):
    A:= Vector(N):
    for p in LTwins do
       A[p*[$1..floor(N/p)]]:= 1;
       A[(p+2)*[$1..floor(N/(p+2))]]:= 1;
    od:
    select(t -> A[t]<>1, [$1..N]); # Robert Israel, May 11 2015
  • Mathematica
    Select[Range@296, #==1 || (p = First /@ FactorInteger@#; Nor @@ Flatten@ PrimeQ@ {p+2, p-2}) &] (* Giovanni Resta, May 12 2015 *)
  • PARI
    isok(n) = {my(f = factor(n)); for (i=1, #f~, p = f[i, 1]; if (isprime(p-2) || isprime(p+2), return (0));); return (1);} \\ Michel Marcus, May 20 2014

Extensions

Offset changed to 1 by Michel Marcus, May 20 2014

A134099 Odd nonprimes np such that np-2 is a prime number but np+2 is not.

Original entry on oeis.org

25, 33, 49, 55, 63, 75, 85, 91, 115, 133, 141, 153, 159, 169, 175, 183, 201, 213, 235, 243, 253, 259, 265, 273, 285, 295, 319, 333, 339, 355, 361, 369, 375, 385, 391, 403, 411, 423, 435, 445, 451, 469, 481, 493, 505, 511, 525, 543, 549, 559, 565, 573, 579
Offset: 1

Views

Author

Enoch Haga, Oct 08 2007

Keywords

Comments

Primes referred to in the example are found in A124582 (see A083370 and compare A124582).

Examples

			a(1) = 25 because it is an odd nonprime preceded by the prime 23 and followed by the odd nonprime 27.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5,1000,2], !PrimeQ[#] && PrimeQ[#-2] && !PrimeQ[#+2]&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *)
    2#-1&/@(Mean/@SequencePosition[Table[If[PrimeQ[n],1,0],{n,1,601,2}],{1,0,0}]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 31 2020 *)
    Select[Partition[Range[600],5,2],PrimeQ[#[[1]]]&&AllTrue[{#[[3]],#[[5]]},CompositeQ]&][[;;,3]] (* Harvey P. Dale, May 14 2023 *)
  • UBASIC
    10 'primes using counters 20 N=3:print "2 ";:print "3 ";:C=2 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 55 55 Q=N+2:R=N-2: if Q<>prmdiv(Q) and N<>prmdiv(N) and R=prmdiv(R) then print Q;N;R;"-";:stop:else N=N+2:goto 30 60 A=A+2 70 if A<=sqrt(N) then 40:stop 81 C=C+1 100 N=N+2:goto 30

Extensions

Definition corrected by Jens Voß, Mar 12 2014
Definition modified by Harvey P. Dale, May 14 2023

A134100 Primes p > 3 such that neither p-2 nor p-4 are prime.

Original entry on oeis.org

29, 37, 53, 59, 67, 79, 89, 97, 127, 137, 149, 157, 163, 173, 179, 191, 211, 223, 239, 251, 257, 263, 269, 277, 293, 307, 331, 337, 347, 359, 367, 373, 379, 389, 397, 409, 419, 431, 439, 449, 457, 479, 487, 499, 509, 521, 541, 547, 557, 563, 569, 577, 587
Offset: 1

Views

Author

Enoch Haga, Oct 08 2007

Keywords

Comments

Upper primes after a prime gap of 6 or larger (Union of A031925, A031927, A031929, ...) - R. J. Mathar, Mar 15 2012

Examples

			29 is a term because 29 follows the odd nonprime 27 which in turn follows the odd nonprime 25.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5,1000,2],PrimeQ[#]&&!PrimeQ[#-2]&&!PrimeQ[#-4]&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *)
  • PARI
    forprime(p=5,600,if(!isprime(p-2) && !isprime(p-4), print1(p,", "))); \\ Joerg Arndt, Oct 27 2021
    
  • PARI
    list(lim)=my(v=List(),p=23); forprime(q=29,lim, if(q-p>4, listput(v,q)); p=q); Vec(v) \\ Charles R Greathouse IV, Oct 27 2021

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Oct 27 2021

Extensions

Name corrected by Michel Marcus and Amiram Eldar, Oct 27 2021

A134101 Odd nonprimes such that the prior odd number is not a prime but the next odd number is a prime.

Original entry on oeis.org

27, 35, 51, 57, 65, 77, 87, 95, 125, 135, 147, 155, 161, 171, 177, 189, 209, 221, 237, 249, 255, 261, 267, 275, 291, 305, 329, 335, 345, 357, 365, 371, 377, 387, 395, 407, 417, 429, 437, 447, 455, 477, 485, 497, 507, 519, 539, 545, 555, 561, 567, 575, 585
Offset: 1

Views

Author

Enoch Haga, Oct 08 2007

Keywords

Examples

			a(1)=27 because this odd nonprime is followed by the prime 29 but preceded by the odd nonprime 25.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5,1000,2],!PrimeQ[#]&&!PrimeQ[#-2]&&PrimeQ[#+2]&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *)
    Transpose[Select[Partition[Range[1,601,2],3,1],Boole[PrimeQ[#]]=={0,0,1}&]] [[2]] (* or *) 2#+1&/@Flatten[Position[Partition[Boole[PrimeQ[ Range[ 1,601,2]]],3,1],?(#=={0,0,1}&)]] (* _Harvey P. Dale, Jan 04 2015 *)
  • UBASIC
    10 'primes using counters 20 N=3:print "2 ";:print "3 ";:C=2 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 55 55 Q=N-2:R=N+2: if Q<>prmdiv(Q) and N<>prmdiv(N) and R=prmdiv(R) then print Q;N;R;"-";:stop:else N=N+2:goto 30 60 A=A+2 70 if A<=sqrt(N) then 40:stop 81 C=C+1 100 N=N+2:goto 30

Extensions

Definition clarified by Harvey P. Dale, Jan 04 2015
Previous Showing 11-20 of 98 results. Next