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.

Showing 1-10 of 44 results. Next

A373401 Least k such that the k-th maximal antirun of prime numbers > 3 has length n. Position of first appearance of n in A027833. The sequence ends if no such antirun exists.

Original entry on oeis.org

1, 2, 4, 6, 10, 8, 69, 40, 24, 46, 41, 21, 140, 82, 131, 210, 50, 199, 35, 30, 248, 192, 277, 185, 458, 1053, 251, 325, 271, 645, 748, 815, 811, 1629, 987, 826, 1967, 423, 1456, 2946, 1109, 406, 1870, 1590, 3681, 2920, 3564, 6423, 1426, 5953, 8345, 12687, 6846
Offset: 1

Views

Author

Gus Wiseman, Jun 09 2024

Keywords

Comments

The sorted version is A373402.
For this sequence, we define an antirun to be an interval of positions at which consecutive primes differ by at least 3.

Examples

			The maximal antiruns of prime numbers > 3 begin:
    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
The a(n)-th rows are:
     5
     7   11
    19   23   29
    43   47   53   59
   109  113  127  131  137
    73   79   83   89   97  101
  2269 2273 2281 2287 2293 2297 2309
  1093 1097 1103 1109 1117 1123 1129 1151
   463  467  479  487  491  499  503  509  521
For example, (19, 23, 29) is the first maximal antirun of length 3, so a(3) = 4.
		

Crossrefs

For composite instead of prime we have A073051.
For runs instead of antiruns we have the triple (4,2,1), firsts of A251092.
For squarefree instead of prime we have A373128, firsts of A373127.
The sorted version is A373402.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A046933 counts composite numbers between primes.

Programs

  • Mathematica
    t=Length/@Split[Select[Range[4,100000],PrimeQ],#1+2!=#2&]//Most;
    spna[y_]:=Max@@Select[Range[Length[y]],SubsetQ[t,Range[#]]&];
    Table[Position[t,k][[1,1]],{k,spna[t]}]

A373402 Numbers k such that the k-th maximal antirun of prime numbers > 3 has length different from all prior maximal antiruns. Sorted list of positions of first appearances in A027833.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 21, 24, 30, 35, 40, 41, 46, 50, 69, 82, 131, 140, 185, 192, 199, 210, 248, 251, 271, 277, 325, 406, 423, 458, 645, 748, 811, 815, 826, 831, 987, 1053, 1109, 1426, 1456, 1590, 1629, 1870, 1967, 2060, 2371, 2607, 2920, 2946, 3564, 3681, 4119
Offset: 1

Views

Author

Gus Wiseman, Jun 10 2024

Keywords

Comments

The unsorted version is A373401.
For this sequence, we define an antirun to be an interval of positions at which consecutive primes differ by at least 3.

Examples

			The maximal antiruns of prime numbers > 3 begin:
    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
The a(n)-th rows begin:
    5
    7  11
   19  23  29
   43  47  53  59
   73  79  83  89  97 101
  109 113 127 131 137
		

Crossrefs

For squarefree runs we have the triple (1,3,5), firsts of A120992.
For prime runs we have the triple (1,2,3), firsts of A175632.
For nonsquarefree runs we have A373199 (assuming sorted), firsts of A053797.
For squarefree antiruns: A373200, unsorted A373128, firsts of A373127.
For composite runs we have A373400, unsorted A073051.
The unsorted version is A373401, firsts of A027833.
For composite antiruns we have the triple (1,2,7), firsts of A373403.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    t=Length/@Split[Select[Range[4,10000],PrimeQ],#1+2!=#2&]//Most;
    Select[Range[Length[t]],FreeQ[Take[t,#-1],t[[#]]]&]

A057820 First differences of sequence of consecutive prime powers (A000961).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, 3, 4, 2, 6, 2, 2, 6, 8, 4, 2, 4, 2, 4, 8, 4, 2, 1, 3, 6, 2, 10, 2, 6, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 8, 5, 1, 6, 6, 2, 6, 4, 2, 6, 4, 14, 4, 2, 4, 14, 6, 6, 4, 2, 4, 6, 2, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10
Offset: 1

Views

Author

Labos Elemer, Nov 08 2000

Keywords

Comments

a(n) = 1 iff A000961(n) = A006549(k) for some k. - Reinhard Zumkeller, Aug 25 2002
Also run lengths of distinct terms in A070198. - Reinhard Zumkeller, Mar 01 2012
Does this sequence contain all positive integers? - Gus Wiseman, Oct 09 2024

Examples

			Odd differences arise in pairs in neighborhoods of powers of 2, like {..,2039,2048,2053,..} gives {..,11,5,..}
		

Crossrefs

For perfect-powers (A001597) we have A053289.
For non-perfect-powers (A007916) we have A375706.
Positions of ones are A375734.
Run-compression is A376308.
Run-lengths are A376309.
Sorted positions of first appearances are A376340.
The second (instead of first) differences are A376596, zeros A376597.
Prime-powers:
- terms: A000961 or A246655, complement A024619
- differences: A057820 (this), first appearances A376341
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708 (ones A375713)
- anti-runs: A373679, A373575, A255346, A373672

Programs

  • Haskell
    a057820_list = zipWith (-) (tail a000961_list) a000961_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Maple
    A057820 := proc(n)
            A000961(n+1)-A000961(n) ;
    end proc: # R. J. Mathar, Sep 23 2016
  • Mathematica
    Map[Length, Split[Table[Apply[LCM, Range[n]], {n, 1, 150}]]] (* Geoffrey Critzer, May 29 2015 *)
    Join[{1},Differences[Select[Range[500],PrimePowerQ]]] (* Harvey P. Dale, Apr 21 2022 *)
  • PARI
    isA000961(n) = (omega(n) == 1 || n == 1)
    n_prev=1;for(n=2,500,if(isA000961(n),print(n-n_prev);n_prev=n)) \\ Michael B. Porter, Oct 30 2009
    
  • Python
    from sympy import primepi, integer_nthroot
    def A057820(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        r, k = m, f(m)+1
        while r != k: r, k = k, f(k)+1
        return r-m # Chai Wah Wu, Sep 12 2024

Formula

a(n) = A000961(n+1) - A000961(n).

Extensions

Offset corrected and b-file adjusted by Reinhard Zumkeller, Mar 03 2012

A053797 Lengths of successive gaps between squarefree numbers.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 07 2000

Keywords

Comments

From Gus Wiseman, Jun 11 2024: (Start)
Also the length of the n-th maximal run of nonsquarefree numbers. These runs begin:
4
8 9
12
16
18
20
24 25
27 28
32
36
40
44 45
48 49 50
(End)

Examples

			The first gap is at 4 and has length 1; the next starts at 8 and has length 2 (since neither 8 nor 9 are squarefree).
		

Crossrefs

Gaps between terms of A005117.
For squarefree runs we have A120992, antiruns A373127 (firsts A373128).
For composite runs we have A176246 (rest of A046933), antiruns A373403.
For prime runs we have A251092 (rest of A175632), antiruns A027833.
Position of first appearance of n is A373199(n).
For antiruns instead of runs we have A373409.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.

Programs

  • Maple
    SF:= select(numtheory:-issqrfree,[$1..1000]):
    map(`-`,select(`>`,SF[2..-1]-SF[1..-2],1),1); # Robert Israel, Sep 22 2015
  • Mathematica
    ReplaceAll[Differences[Select[Range@384, SquareFreeQ]] - 1, 0 -> Nothing] (* Michael De Vlieger, Sep 22 2015 *)

Extensions

Offset set to 1 by Peter Kagey, Sep 29 2015

A029707 Numbers n such that the n-th and the (n+1)-st primes are twin primes.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, 57, 60, 64, 69, 81, 83, 89, 98, 104, 109, 113, 116, 120, 140, 142, 144, 148, 152, 171, 173, 176, 178, 182, 190, 201, 206, 209, 212, 215, 225, 230, 234, 236, 253, 256, 262, 265, 268, 277
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Numbers m such that prime(m)^2 == 1 mod (prime(m) + prime(m + 1)). - Zak Seidov, Sep 18 2013
First differences are A027833. The complement is A049579. - Gus Wiseman, Dec 03 2024

Crossrefs

Cf. A014574, A027833 (first differences), A007508. Equals PrimePi(A001359) (cf. A000720).
The complement is A049579, first differences A251092 except first term.
Lengths of runs of terms differing by 2 are A179067.
The first differences have run-lengths A373820 except first term.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A038664 finds the first prime gap of 2n.
A046933 counts composite numbers between primes.
For prime runs: A005381, A006512, A025584, A067774.

Programs

  • Maple
    A029707 := proc(n)
        numtheory[pi](A001359(n)) ;
    end proc:
    seq(A029707(n),n=1..30); # R. J. Mathar, Feb 19 2017
  • Mathematica
    Select[ Range@300, PrimeQ[ Prime@# + 2] &] (* Robert G. Wilson v, Mar 11 2007 *)
    Flatten[Position[Flatten[Differences/@Partition[Prime[Range[100]],2,1]], 2]](* Harvey P. Dale, Jun 05 2014 *)
  • Sage
    def A029707(n) :
       a = [ ]
       for i in (1..n) :
          if (nth_prime(i+1)-nth_prime(i) == 2) :
             a.append(i)
       return(a)
    A029707(277) # Jani Melik, May 15 2014

Formula

a(n) = A107770(n) - 1. - Juri-Stepan Gerasimov, Dec 16 2009

A373403 Length of the n-th maximal antirun of composite numbers differing by more than one.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

This antirun ranges from A005381 (with 4 prepended) to A068780, with sum A373404.
An antirun of a sequence (in this case A002808) is an interval of positions such that consecutive terms differ by more than one.

Examples

			Row-lengths of:
   4   6   8
   9
  10  12  14
  15
  16  18  20
  21
  22  24
  25
  26
  27
  28  30  32
  33
  34
  35
  36  38
  39
  40  42  44
		

Crossrefs

Functional neighbors: A005381, A027833 (partial sums A029707), A068780, A176246 (rest of A046933, firsts A073051), A373127, A373404, A373409.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Length/@Split[Select[Range[100],CompositeQ],#1+1!=#2&]//Most

Formula

a(2n) = 1.
a(2n - 1) = A196274(n) for n > 1.

A110969 Length of the runs of ones in A014963.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 4, 3, 1, 3, 1, 3, 5, 1, 2, 2, 3, 1, 5, 1, 1, 5, 7, 3, 1, 3, 1, 3, 7, 3, 1, 2, 5, 1, 9, 1, 5, 5, 3, 1, 3, 5, 1, 9, 1, 3, 1, 11, 11, 3, 1, 3, 5, 1, 1, 7, 4, 5, 5, 1, 5, 3, 1, 5, 3, 13, 3, 1, 3, 13, 5, 5, 3, 1, 3, 5, 1, 5, 5, 5, 3, 5, 7, 3, 7
Offset: 1

Views

Author

Franz Vrabec, Sep 27 2005

Keywords

Comments

Unbounded sequence.
From A373669 we see that 10 first appears at a(28195574) = 10.
Also run-lengths of non-prime-powers (assuming 1 is not a prime-power), where a run of a sequence (in this case A361102) is an interval of positions at which consecutive terms differ by one. Also nonzero differences of consecutive prime-powers minus one. - Gus Wiseman, Jun 18 2024

Examples

			a(5)=2 because the fifth run of ones in A014963 is of length 2.
		

Crossrefs

Cf. A014963.
Positions of first appearances are A373670, sorted A373669.
For runs of prime-powers:
- length A174965, antiruns A373671
- min A373673, antiruns A120430
- max A373674, antiruns A006549
- sum A373675, antiruns A373576
For runs of non-prime-powers:
- length A110969 (this sequence), antiruns A373672
- min A373676, antiruns A373575
- max A373677, antiruns A255346
- sum A373678, antiruns A373679
A000961 lists all powers of primes. A246655 lists just prime-powers.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A356068 counts non-prime-powers up to n.
A361102 lists all non-prime-powers (A024619 if not including 1).
Various run-lengths: A053797, A120992, A175632, A176246.
Various antirun-lengths: A027833, A373127, A373403, A373409.

Programs

  • Mathematica
    Length /@ SplitBy[Table[Exp[MangoldtLambda[n]], {n, 400}], # != 1 &][[ ;; -1 ;; 2]] (* Michael De Vlieger, Mar 21 2024 *)
    DeleteCases[Differences[Select[Range[100],PrimePowerQ]]-1,0] (* Gus Wiseman, Jun 18 2024 *)
  • PARI
    \\ b(n) returns boolean of A014963(n) == 1.
    b(n)={my(t); !isprime(if(ispower(n, ,&t), t, n))}
    seq(n)={my(k=1, i=0, L=List()); while(#Lk, listput(L, i-k)); k = i+1)); Vec(L)} \\ Andrew Howroyd, Jan 02 2020

Extensions

Terms a(41) and beyond from Andrew Howroyd, Jan 02 2020

A373127 Length of the n-th maximal antirun of squarefree numbers differing by more than one.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 1, 4, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 5, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 4, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 1, 2, 2, 1, 2, 1, 2, 4, 2, 1, 4, 1, 3, 2, 1, 2, 1, 2, 1, 2, 2, 1, 4, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 4, 1, 3, 4, 1, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The sum of this antirun is given by A373411.
An antirun of a sequence (in this case A005117) is an interval of positions at which consecutive terms differ by more than one.

Examples

			Row-lengths of:
   1
   2
   3  5
   6
   7 10
  11 13
  14
  15 17 19 21
  22
  23 26 29
  30
  31 33
  34
  35 37
  38
  39 41
  42
  43 46
  47 51 53 55 57
		

Crossrefs

Positions of first appearances are A373128, sorted A373200.
Functional neighbors: A007674, A027833 (partial sums A029707), A120992, A373403, A373408, A373409, A373411.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A077643 counts squarefree numbers with n bits, sum A373123.

Programs

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

A373671 Length of the n-th maximal antirun of prime-powers.

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 7, 26, 27, 1007, 5558, 5734, 31209
Offset: 1

Views

Author

Gus Wiseman, Jun 14 2024

Keywords

Comments

An antirun of a sequence (in this case A000961 without 1) is an interval of positions at which consecutive terms differ by more than one.

Examples

			The maximal antiruns of prime-powers begin:
   2
   3
   4
   5   7
   8
   9  11  13  16
  17  19  23  25  27  29  31
		

Crossrefs

For prime antiruns we have A027833.
For nonsquarefree runs we have A053797, firsts A373199.
For non-prime-powers runs we have A110969, firsts A373669, sorted A373670.
For squarefree runs we have A120992.
For prime-power runs we have A174965.
For prime runs we have A175632.
For composite runs we have A176246, firsts A073051, sorted A373400.
For squarefree antiruns we have A373127, firsts A373128.
For composite antiruns we have A373403.
For antiruns of prime-powers:
- length A373671 (this sequence)
- min A120430
- max A006549
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
A000961 lists the powers of primes (including 1).
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists the non-prime-powers (not including 1 A024619).

Programs

  • Mathematica
    Length/@Split[Select[Range[100],PrimePowerQ[#]&],#1+1!=#2&]//Most

Formula

Partial sums are A025528(A006549(n)).

A373672 Length of the n-th maximal antirun of non-prime-powers.

Original entry on oeis.org

5, 3, 1, 6, 1, 1, 2, 1, 3, 1, 3, 1, 2, 1, 1, 1, 3, 2, 2, 1, 3, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 1, 3, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1
Offset: 1

Views

Author

Gus Wiseman, Jun 14 2024

Keywords

Comments

An antirun of a sequence (in this case A361102 or A024619 with 1) is an interval of positions at which consecutive terms differ by more than one.

Examples

			The maximal antiruns of non-prime-powers begin:
   1   6  10  12  14
  15  18  20
  21
  22  24  26  28  30  33
  34
  35
  36  38
  39
  40  42  44
  45
  46  48  50
		

Crossrefs

For prime antiruns we have A027833.
For nonsquarefree runs we have A053797, firsts A373199.
For non-prime-powers runs we have A110969, firsts A373669, sorted A373670.
For squarefree runs we have A120992.
For prime-power runs we have A174965.
For prime runs we have A175632.
For composite runs we have A176246, firsts A073051, sorted A373400.
For squarefree antiruns we have A373127, firsts A373128.
For composite antiruns we have A373403.
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
For antiruns of non-prime-powers:
- length A373672 (this sequence), firsts (3,7,2,25,1,4)
- min A373575
- max A255346
A000961 lists all powers of primes. A246655 lists just prime-powers.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A356068 counts non-prime-powers up to n.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    Length/@Split[Select[Range[100],!PrimePowerQ[#]&],#1+1!=#2&]//Most

Formula

Partial sums are A356068(A255346(n)).
Showing 1-10 of 44 results. Next