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 51-60 of 478 results. Next

A373405 Sum of the n-th maximal antirun of odd primes differing by more than two.

Original entry on oeis.org

3, 5, 18, 30, 71, 109, 202, 199, 522, 210, 617, 288, 990, 372, 390, 860, 701, 1281, 829, 1194, 1645, 4578, 852, 2682, 4419, 3300, 2927, 2438, 1891, 2602, 14660, 1632, 1650, 3378, 3480, 18141, 2052, 3121, 2112, 4310, 8922, 13131, 6253, 3851, 3889, 3929, 13788
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The length of this run is given by A027833 (except initial term).
An antirun of a sequence (in this case A000040\{2}) is an interval of positions at which consecutive terms differ by more than one.

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 101
		

Crossrefs

The partial sums are a subset of A071148 (partial sums of odd primes).
Functional neighbors: A001359, A006512, A027833 (partial sums A029707), A373404, A373406, A373411, A373412.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.

Programs

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

A029908 Starting with n, repeatedly sum prime factors (with multiplicity) until reaching 0 or a fixed point. Then a(n) is the fixed point (or 0).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

That is, the sopfr function (see A001414) applied repeatedly until reaching 0 or a fixed point.
For n > 1, the sequence reaches a fixed point which is either 4 or a prime.
A002217(n) is number of terms in sequence from n to a(n). - Reinhard Zumkeller, Apr 08 2003
Because sopfr(n) <= n (with equality at 4 and the primes), the first appearance of all primes is in the natural order: 2,3,5,7,11,... . - Zak Seidov, Mar 14 2011
The terms 0, 2, 3 and 4 occur exactly once, because no number > 5 can have factors that sum to be < 5, and therefore can never enter a trajectory that will drop below 5. - Christian N. K. Anderson, May 19 2013
For all primes p, where p is contained in A001359, then a(p^2) = p + 2. (A006512). Proof: p^2 has prime factors (p, p). This sums to 2p. 2p has factors (2, p). This sums to p + 2. Since p was the lesser of a twin prime, then p + 2 is the greater of a twin prime. - Ryan Bresler, Nov 04 2021

Examples

			20 -> 2+2+5 = 9 -> 3+3 = 6 -> 2+3 = 5, so a(20)=5.
		

Crossrefs

Cf. A001414 (sum of prime factors of n).

Programs

  • Maple
    f:= proc(n) option remember;
    if isprime(n) then n
    else `procname`(add(x[1]*x[2], x = ifactors(n)[2]))
    fi
    end proc:
    f(1):= 0: f(4):= 4:
    map(f, [$1..100]); # Robert Israel, Apr 27 2015
  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] ep[x_] := Table[Part[ffi[x], 2*w], {w, 1, lf[x]}] slog[x_] := slog[x_] := Apply[Plus, ba[x]*ep[x]] Table[FixedPoint[slog, w], {w, 1, 128}]
    f[n_] := Plus @@ Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger@n]; Array[ FixedPoint[f, # ] &, 87] (* Robert G. Wilson v, Jan 18 2006 *)
    fz[n_]:=Plus@@(#[[1]]*#[[2]]&/@FactorInteger@n); Array[FixedPoint[fz,#]&,1000] (* Zak Seidov, Mar 14 2011 *)
  • Python
    from sympy import factorint
    def a(n, pn):
        if n == pn:
            return n
        else:
            return a(sum(p*e for p, e in factorint(n).items()), n)
    print([a(i, None) for i in range(1, 100)]) # Gleb Ivanov, Nov 05 2021

A066388 Numbers j such that j and 2j are both between a pair of twin primes.

Original entry on oeis.org

6, 30, 660, 810, 2130, 2550, 3330, 3390, 5850, 6270, 10530, 33180, 41610, 44130, 53550, 55440, 57330, 63840, 65100, 70380, 70980, 72270, 74100, 74760, 78780, 80670, 81930, 87540, 93240, 102300, 115470, 124770, 133980, 136950, 156420
Offset: 1

Views

Author

Jud McCranie, Dec 23 2001

Keywords

Comments

Also terms of A014574 such that twice the term is also in A014574. Related to a problem of anti-divisors.
All a(n) > 6 must be a multiple of 30: As for elements of A014574, we must have a(n) = 6k, and k = 5m+-1 would lead to a(n)-+1 divisible by 5, while k = 5m+-2 would lead to 2*a(n)+-1 divisible by 5, so only k=5m is possible. - M. F. Hasler, Nov 27 2010

Examples

			j = 30 is a term since 29 and 31 are prime, as are 59 and 61.
		

Crossrefs

Subsequence of A014574.
Subsequences: A118859, A118860, A349321.

Programs

  • Mathematica
    lst={}; Do[p1=Prime[n]; p2=Prime[n+1]; d=2; If[p2-p1==d, w=p1+1; If[PrimeQ[2*w-1]&&PrimeQ[2*w+1], AppendTo[lst, w]]], {n, 1, 10^4}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
  • PARI
    { n=0; forstep (m=2, 10^9, 2, if (isprime(m - 1) && isprime(m + 1) && isprime(2*m - 1) && isprime(2*m + 1), write("b066388.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Feb 13 2010

Formula

A117499(a(n)) = 4. - Reinhard Zumkeller, Mar 23 2006
{k in A014574: 2*k in A014574}. - R. J. Mathar, Jan 20 2025

A373410 Minimum of the n-th maximal antirun of nonsquarefree numbers differing by more than one.

Original entry on oeis.org

4, 9, 25, 28, 45, 49, 50, 64, 76, 81, 99, 100, 117, 121, 125, 126, 136, 148, 153, 169, 172, 176, 189, 208, 225, 243, 244, 245, 261, 276, 280, 289, 297, 316, 325, 333, 343, 344, 351, 352, 361, 364, 369, 376, 388, 405, 424, 425, 441, 460, 476, 477, 496, 508, 513
Offset: 1

Views

Author

Gus Wiseman, Jun 06 2024

Keywords

Comments

The maximum is given by A068781.
An antirun of a sequence (in this case A013929) is an interval of positions at which consecutive terms differ by more than one.
Consists of 4 and all nonsquarefree numbers n such that n - 1 is also nonsquarefree.

Examples

			Row-minima of:
   4   8
   9  12  16  18  20  24
  25  27
  28  32  36  40  44
  45  48
  49
  50  52  54  56  60  63
  64  68  72  75
  76  80
  81  84  88  90  92  96  98
  99
		

Crossrefs

Functional neighbors: A005381, A006512, A053806, A068781, A373408, A373409, A373412.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.

Programs

  • Mathematica
    First/@Split[Select[Range[100],!SquareFreeQ[#]&],#1+1!=#2&]

Formula

a(1) = 4; a(n>1) = A068781(n-1) + 1.

A164292 Binary sequence identifying the twin primes (characteristic function of twin primes: 1 if n is a twin prime else 0).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0
Offset: 1

Views

Author

Carlos Alves, Aug 12 2009

Keywords

Comments

Similar to prime binary digit sequence A010051.
In decimal notation A164292=0.1646823906345389353962381...
See also A164293 (similar to prime decimal sequence A051006).
a(A001097(n))=1; a(A001359(n))=1; a(A006512(n))=1. - Reinhard Zumkeller, Mar 29 2010
Characteristic function of A001097. - Georg Fischer, Aug 04 2021

Crossrefs

Programs

  • Haskell
    a164292 1 = 0
    a164292 2 = 0
    a164292 n = signum (a010051' n * (a010051' (n - 2) + a010051' (n + 2)))
    -- Reinhard Zumkeller, Feb 03 2014
  • Mathematica
    Table[(PrimePi[n] - PrimePi[n - 1]) * Ceiling[(PrimePi[n + 2] - PrimePi[n + 1] + PrimePi[n - 2] - PrimePi[n - 3])/2], {n, 100}] (* Wesley Ivan Hurt, Jan 31 2014 *)
    Table[If[PrimeQ[n]&&AnyTrue[n+{2,-2},PrimeQ],1,0],{n,120}] (* Harvey P. Dale, Jan 04 2025 *)

Formula

a(n) = A057427(A010051(n)*(A010051(n-2)+A010051(n+2))), for n>2. - Reinhard Zumkeller, Mar 29 2010
a(n) = c(n) * ceiling(( c(n+2) + c(n-2) )/2), where c is the prime characteristic. - Wesley Ivan Hurt, Jan 31 2014

A166944 a(1)=2; a(n) = a(n-1) + gcd(n, a(n-1)) if n is even, a(n) = a(n-1) + gcd(n-2, a(n-1)) if n is odd.

Original entry on oeis.org

2, 4, 5, 6, 9, 12, 13, 14, 21, 22, 23, 24, 25, 26, 39, 40, 45, 54, 55, 60, 61, 62, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 129, 130, 135, 138, 139, 140, 147, 148, 149, 150, 151, 152, 153, 154, 155, 160, 161, 162, 163
Offset: 1

Views

Author

Vladimir Shevelev, Oct 24 2009

Keywords

Comments

Conjecture: Every record of differences a(n)-a(n-1) more than 5 is the greater of twin primes (A006512).

Crossrefs

Programs

  • Maple
    A166944 := proc(n) option remember; if n = 1 then 2; else p := procname(n-1) ; if type(n,'even') then p+igcd(n,p) ; else p+igcd(n-2,p) ; end if; end if; end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[OddQ[n],a+GCD[n+1,a],a+GCD[n-1,a]]}; Transpose[ NestList[ nxt,{1,2},70]][[2]] (* Harvey P. Dale, Feb 10 2015 *)
  • PARI
    print1(a=2); for(n=2, 100, d=gcd(a, if(n%2, n-2, n)); print1(", "a+=d)) \\ Charles R Greathouse IV, Oct 13 2017

Extensions

Terms beginning with a(18) corrected by Vladimir Shevelev, Nov 10 2009

A181490 Numbers k such that 3*2^k-1 and 3*2^k+1 are twin primes (A001097).

Original entry on oeis.org

1, 2, 6, 18
Offset: 1

Views

Author

M. F. Hasler, Oct 30 2010

Keywords

Comments

Sequences A181491 and A181492 list the corresponding primes.
No more terms below three million. - Charles R Greathouse IV, Mar 14 2011
Intersection of A002235 and A002253. - Jeppe Stig Nielsen, Mar 05 2018

Crossrefs

Programs

  • GAP
    Filtered([1..300],k->IsPrime(3*2^k-1) and IsPrime(3*2^k+1)); # Muniru A Asiru, Mar 11 2018
  • Maple
    a:=k->`if`(isprime(3*2^k-1) and isprime(3*2^k+1),k,NULL); seq(a(k),k=1..1000); # Muniru A Asiru, Mar 11 2018
  • Mathematica
    fQ[n_] := PrimeQ[3*2^n - 1] && PrimeQ[3*2^n + 1]; k = 1; lst= {}; While[k < 15001, If[fQ@k, AppendTo[lst, k]; Print@k]; k++ ] (* Robert G. Wilson v, Nov 05 2010 *)
    Select[Range[20],AllTrue[3*2^#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 24 2014 *)
  • PARI
    for( k=1,999, ispseudoprime(3<
    				

Formula

Equals { k | A007283(k) in A014574 } = { k | A153893(k) in A001359 }.

Extensions

Pari program repaired by Charles R Greathouse IV, Mar 14 2011

A236457 Primes p with q = p + 2 and prime(q) + 2 both prime.

Original entry on oeis.org

3, 5, 11, 41, 107, 311, 461, 599, 641, 1277, 1619, 1997, 2309, 2381, 2789, 3671, 4787, 5099, 6659, 6701, 6827, 7457, 7487, 8219, 8537, 8597, 9929, 10709, 11117, 12071, 12107, 12251, 13709, 17747, 18047, 18251, 18521, 22091, 22637, 23027
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 26 2014

Keywords

Comments

According to the conjecture in A236456, this sequence should have infinitely many terms.
See A236458 for a similar sequence.

Examples

			a(1) = 3 since 3 + 2 = 5 and prime(5) + 2 = 13 are both prime, but 2 + 2 = 4 is not.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[n+2]&&PrimeQ[Prime[n+2]+2]
    In[2]:= n=0;Do[If[p[Prime[m]],n=n+1;Print[n," ",Prime[m]]],{m,1,10000}]
    Select[Prime[Range[2600]],AllTrue[{#+2,Prime[#+2]+2},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 21 2021 *)
  • PARI
    s=[]; forprime(p=2, 24000, q=p+2; if(isprime(q) && isprime(prime(q)+2), s=concat(s, p))); s \\ Colin Barker, Jan 26 2014

A373820 Run-lengths (differing by 0) of antirun-lengths (differing by > 2) of odd primes.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 22 2024

Keywords

Comments

Run-lengths of the version of A027833 with 1 prepended.

Examples

			The antiruns of odd primes (differing by > 2) begin:
   3
   5
   7  11
  13  17
  19  23  29
  31  37  41
  43  47  53  59
  61  67  71
  73  79  83  89  97 101
 103 107
 109 113 127 131 137
 139 149
 151 157 163 167 173 179
 181 191
 193 197
 199 211 223 227
 229 233 239
 241 251 257 263 269
 271 277 281
with lengths:
1, 1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, ...
with runs:
  1  1
  2  2
  3  3
  4
  3
  6
  2
  5
  2
  6
  2  2
  4
  3
  5
  3
  4
with lengths a(n).
		

Crossrefs

Run-lengths of A027833 (if we prepend 1), partial sums A029707.
For runs we have A373819, run-lengths of A251092.
Positions of first appearances are A373827, sorted A373826.
A000040 lists the primes.
A001223 gives differences of consecutive primes, run-lengths A333254, run-lengths of run-lengths A373821.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
For composite runs: A005381, A054265, A068780, A373403, A373404.

Programs

  • Mathematica
    Length/@Split[Length/@Split[Select[Range[3,1000],PrimeQ],#2-#1>2&]//Most]//Most

A053319 Distance between the smaller members of successive twin prime pairs.

Original entry on oeis.org

2, 6, 6, 12, 12, 18, 12, 30, 6, 30, 12, 30, 12, 6, 30, 12, 30, 12, 30, 36, 72, 12, 30, 60, 48, 30, 18, 24, 18, 150, 12, 6, 30, 24, 138, 12, 18, 12, 30, 60, 78, 48, 12, 12, 18, 108, 24, 30, 6, 120, 12, 48, 30, 24, 66, 84, 6, 54, 18, 48, 30, 54, 6, 24, 18, 12, 96, 30, 42, 30, 42
Offset: 1

Views

Author

Labos Elemer, Mar 06 2000

Keywords

Comments

Conjecture: a(n) < log(A014574(n))^3 for n > 2. - Thomas Ordowski, Jul 21 2012
This is of course also the distance between the larger members of successive twin primes. - Franklin T. Adams-Watters, Jun 03 2014

Crossrefs

First differences of A001359, A006512, and of A014574.

Programs

  • Mathematica
    Differences[Transpose[Select[Partition[Prime[Range[450]],2,1],Last[#]-First[#]==2&]][[1]]]  (* Harvey P. Dale, Feb 08 2011 *)
  • PARI
    {cnt=0; lp= /*last*/ ltp=/*last twin(upper)*/ 5;
    forprime(p=lp+1,default(primelimit), if(p-lp != 2,lp=p;next);
    write("b053319.txt",cnt++" "p-ltp);/* print1(p-ltp", ");*/ ltp=lp=p)} \\ M. F. Hasler, May 26 2007

Extensions

Definition clarified by Harvey P. Dale, Feb 08 2011
Previous Showing 51-60 of 478 results. Next