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 123 results. Next

A373400 Numbers k such that the k-th maximal run of composite numbers has length different from all prior maximal runs. Sorted positions of first appearances in A176246 (or A046933 shifted).

Original entry on oeis.org

1, 3, 8, 23, 29, 33, 45, 98, 153, 188, 216, 262, 281, 366, 428, 589, 737, 1182, 1830, 1878, 2190, 2224, 3076, 3301, 3384, 3426, 3643, 3792, 4521, 4611, 7969, 8027, 8687, 12541, 14356, 14861, 15782, 17005, 19025, 23282, 30801, 31544, 33607, 34201, 34214, 38589
Offset: 1

Views

Author

Gus Wiseman, Jun 10 2024

Keywords

Comments

The unsorted version is A073051.
A run of a sequence (in this case A002808) is an interval of positions at which consecutive terms differ by one.

Examples

			The maximal runs of composite numbers begin:
   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  45  46
  48  49  50  51  52
  54  55  56  57  58
  60
  62  63  64  65  66
  68  69  70
  72
  74  75  76  77  78
  80  81  82
  84  85  86  87  88
  90  91  92  93  94  95  96
  98  99 100
The a(n)-th rows are:
   4
   8   9  10
  24  25  26  27  28
  90  91  92  93  94  95  96
 114 115 116 117 118 119 120 121 122 123 124 125 126
 140 141 142 143 144 145 146 147 148
 200 201 202 203 204 205 206 207 208 209 210
		

Crossrefs

The unsorted version is A073051, firsts of A176246.
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 squarefree antiruns we have A373128, firsts of A373127.
For nonsquarefree runs we have A373199 (assuming sorted), firsts of A053797.
For prime antiruns we have A373402, unsorted A373401, firsts of A027833.
For composite runs 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[10000],CompositeQ],#1+1==#2&]//Most;
    Select[Range[Length[t]],FreeQ[Take[t,#-1],t[[#]]]&]

A147965 a(n) = n + 1 - A001223(n) = n - A046933(n). In words, a(n) is the difference between n+1 and the n-th gap between primes.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 6, 5, 4, 9, 6, 9, 12, 11, 10, 11, 16, 13, 16, 19, 16, 19, 18, 17, 22, 25, 24, 27, 26, 17, 28, 27, 32, 25, 34, 31, 32, 35, 34, 35, 40, 33, 42, 41, 44, 35, 36, 45, 48, 47, 46, 51, 44, 49, 50, 51, 56, 53, 56, 59
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=70,prg},prg=Differences[Prime[Range[nn]]];#[[2]]-#[[1]]&/@ Thread[{prg,Range[nn-1]}]+1] (* Harvey P. Dale, Nov 21 2021 *)

Extensions

Definition corrected by N. J. A. Sloane, Nov 21 2021, at the suggestion of Harvey P. Dale.

A256736 Number of composites lying between successive pairs of primes, beginning with pair (3,5). Bisection of A046933.

Original entry on oeis.org

1, 3, 3, 3, 1, 3, 3, 5, 5, 1, 3, 7, 1, 1, 13, 5, 9, 5, 3, 5, 9, 3, 11, 3, 3, 1, 5, 5, 5, 1, 13, 1, 13, 9, 3, 7, 5, 5, 3, 9, 9, 5, 5, 3, 3, 7, 7, 5, 1, 5, 5, 1, 9, 5, 5, 3, 11, 1, 5, 1, 3, 7, 7, 7, 5, 7, 3, 3, 9, 1, 1, 1, 13, 1, 13, 1, 19, 7, 7, 5, 13, 5, 7, 11
Offset: 1

Views

Author

Peter Woodward, Apr 09 2015

Keywords

Examples

			[3,5] contains 4, so a(1)=4.
[7,11] contains 8,9,10, so a(2)=3.
For the third term in the sequence, use prime pair [13,17]. There are three composites between 13 and 17, thus the third term = 3.
		

Crossrefs

Complement of A256737 in regards to forming A046933.

Programs

  • Mathematica
    Table[Prime[n + 1] - Prime[n] - 1, {n, 2, 100, 2}] (* Hartmut F. W. Hoft, Apr 24 2015 *)
  • PARI
    a(n) = prime(2*n+1)-prime(2*n)-1; \\ Jinyuan Wang, Jul 09 2020

Extensions

Corrected and extended by Hartmut F. W. Hoft, Apr 24 2015
More terms from Robert G. Wilson v, May 03 2015

A147966 a(n) = n+(A001223(n)-1) = n+A046933(n).

Original entry on oeis.org

1, 3, 4, 7, 6, 9, 8, 11, 14, 11, 16, 15, 14, 17, 20, 21, 18, 23, 22, 21, 26, 25, 28, 31, 28, 27, 30, 29, 32, 43, 34, 37, 34, 43, 36, 41, 42, 41, 44, 45, 42, 51, 44, 47, 46, 57, 58, 51, 50, 53, 56, 53, 62, 59, 60, 61, 58, 63, 62, 61, 70, 75, 66, 65, 68, 79, 72, 77
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Examples

			a(32) = A001223(32)-1+n = 6-1+32 = A046933(32)+n = 5+n = 37.
		

Crossrefs

Extensions

Definition clarified by N. J. A. Sloane, Nov 22 2021 at the suggestion of Harvey P. Dale.
a(32)=37 corrected by Georg Fischer, Oct 10 2024

A147967 a(n) = n*(A001223(n)-1) = n*A046933(n).

Original entry on oeis.org

0, 2, 3, 12, 5, 18, 7, 24, 45, 10, 55, 36, 13, 42, 75, 80, 17, 90, 57, 20, 105, 66, 115, 168, 75, 26, 81, 28, 87, 390, 93, 160, 33, 306, 35, 180, 185, 114, 195, 200, 41, 378, 43, 132, 45, 506, 517, 144, 49, 150, 255, 52, 477
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Crossrefs

Cf. A001223 ("gap" with its usual meaning), A046933, A141042, A147965, A147966.

Programs

  • Mathematica
    Module[{nn=60,gps},gps=Differences[Prime[Range[nn+1]]]-1;Times@@@ Thread[ {Range[nn],gps}]] (* Harvey P. Dale, Nov 07 2020 *)

Extensions

Definition clarified by N. J. A. Sloane, Nov 22 2021 at the suggestion of Harvey P. Dale.

A256737 Number of composites lying between successive pairs of primes, beginning with pair (2,3). Bisection of A046933.

Original entry on oeis.org

0, 1, 1, 1, 5, 5, 1, 5, 1, 3, 5, 5, 3, 3, 3, 3, 1, 1, 5, 5, 1, 1, 1, 11, 1, 5, 9, 5, 1, 3, 9, 3, 3, 5, 1, 5, 5, 3, 7, 7, 1, 1, 3, 7, 1, 11, 3, 3, 11, 17, 9, 5, 5, 5, 1, 5, 1, 9, 3, 5, 11, 5, 9, 9, 5, 3, 5, 7, 13, 11, 9, 3, 9, 3, 3, 3, 3, 3, 9, 3, 5, 3, 5, 5, 3, 1, 1, 9, 9, 5, 3, 3, 5, 5, 21
Offset: 1

Views

Author

Peter Woodward, Apr 09 2015

Keywords

Examples

			For the third term in the sequence, use prime pair (11,13). Only composite that lies between is "12", thus the third value in the sequence is "1".
		

Crossrefs

Complement of A256736 with respect to A046933.

Programs

  • Mathematica
    Flatten[Differences/@Partition[Prime[Range[200]],2]]-1 (* Harvey P. Dale, Dec 17 2023 *)
  • PARI
    a(n)=my(q=prime(2*n)); q-precprime(q-1)-1 \\ Charles R Greathouse IV, Apr 21 2015

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

A036263 Second differences of primes.

Original entry on oeis.org

1, 0, 2, -2, 2, -2, 2, 2, -4, 4, -2, -2, 2, 2, 0, -4, 4, -2, -2, 4, -2, 2, 2, -4, -2, 2, -2, 2, 10, -10, 2, -4, 8, -8, 4, 0, -2, 2, 0, -4, 8, -8, 2, -2, 10, 0, -8, -2, 2, 2, -4, 8, -4, 0, 0, -4, 4, -2, -2, 8, 4, -10, -2, 2, 10, -8, 4, -8, 2, 2, 2, -2, 0, -2, 2, 2, -4, 4, 2, -8, 8, -8, 4, -2, 2, 2, -4, -2, 2, 8, -4
Offset: 1

Views

Author

Keywords

Examples

			a(3) = 5 + 11 - 2*7 = 16 - 14 = 2.
		

Crossrefs

For records see A293154, A293155.

Programs

  • Haskell
    a036263 n = a036263_list !! (n-1)
    a036263_list = zipWith (-) (tail a001223_list) a001223_list
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Maple
    A036263:=n->ithprime(n) + ithprime(n+2) - 2*ithprime(n+1); seq(A036263(n), n=1..100); # Wesley Ivan Hurt, Apr 01 2014
  • Mathematica
    Table[Prime[n - 1] + Prime[n + 1] - 2*Prime[n], {n, 2, 105}]
    Differences[Prime[Range[100]], 2] (* Harvey P. Dale, Oct 14 2012 *)
  • PARI
    for(n=2,100,print1(prime(n+2)-2*prime(n+1)+prime(n)","))
    
  • Python
    from sympy import prime
    def A036263(n): return prime(n)-(prime(n+1)<<1)+prime(n+2) # Chai Wah Wu, Sep 28 2024

Formula

a(A064113(n)) = 0. - Reinhard Zumkeller, Jan 20 2012
a(n) = prime(n) + prime(n+2) - 2*prime(n+1). - Thomas Ordowski, Jul 21 2012
Conjecture: |a(1)| + |a(2)| + ... + |a(n)| ~ prime(n). - Thomas Ordowski, Jul 21 2012
a(n) = A001223(n+1) - A001223(n). - R. J. Mathar, Sep 19 2013
Sum_{i = 1..n - 1} a(i) = A046933(n), n >= 1. - Daniel Forgues, Apr 15 2014
Sum_{i = 2..n - 1} a(i) = prime(n + 1) - prime(n) - 2; Sum_{i = 2..n - 1} a(i) = 0 whenever prime(n) is a lesser of twin primes. - Hamdi Murat Yildirim, Jun 24 2014

A061398 Number of squarefree integers between prime(n) and prime(n+1).

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 0, 2, 1, 1, 3, 2, 1, 1, 1, 3, 0, 3, 2, 0, 3, 1, 3, 4, 0, 1, 2, 0, 2, 6, 2, 2, 1, 5, 0, 2, 3, 2, 1, 3, 0, 6, 0, 2, 0, 7, 8, 1, 0, 2, 3, 0, 3, 3, 3, 3, 0, 2, 1, 1, 5, 7, 2, 0, 1, 9, 2, 4, 0, 0, 4, 3, 2, 2, 2, 2, 5, 2, 4, 6, 0, 5, 0, 4, 1, 3, 4, 1, 1, 2, 6, 4, 1, 4, 2, 2, 7, 0, 8, 4, 4, 3, 2, 1, 2
Offset: 1

Views

Author

Labos Elemer, Jun 07 2001

Keywords

Examples

			Between 113 and 127 the 6 squarefree numbers are 114, 115, 118, 119, 122, 123, so a(30)=6.
From _Gus Wiseman_, Nov 06 2024: (Start)
The a(n) squarefree numbers for n = 1..16:
  1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16
  ---------------------------------------------------------------
  .   .   6   10  .   14  .   21  26  30  33  38  42  46  51  55
                      15      22          34  39              57
                                          35                  58
(End)
		

Crossrefs

Cf. A179211. [Reinhard Zumkeller, Jul 05 2010]
Counting all composite numbers (not just squarefree) gives A046933.
The version for nonsquarefree numbers is A061399.
Zeros are A068360.
The version for prime-powers is A080101.
Partial sums are A337030.
The version for non-prime-powers is A368748.
Excluding prime(n+1) from the range gives A373198.
Ones are A377430.
Positives are A377431.
The version for perfect-powers is A377432.
The version for non-perfect-powers is A377433 + 2.
For squarefree numbers (A005117) between primes:
- length is A061398 (this sequence)
- min is A112926
- max is A112925
- sum is A373197
For squarefree numbers between powers of two:
- length is A077643 (except initial terms), partial sums A143658
- min is A372683, difference A373125, indices A372540, firsts of A372475
- max is A372889, difference A373126
- sum is A373123
For primes between powers of two:
- length is A036378
- min is A104080 or A014210, indices A372684 (firsts of A035100)
- max is A014234, difference A013603
- sum is A293697 (except initial terms)

Programs

  • Maple
    p:= 2:
    for n from 1 to 200 do
      q:= nextprime(p);
    A[n]:= nops(select(numtheory:-issqrfree, [$p+1..q-1]));
    p:= q;
    od:
    seq(A[i],i=1..200); # Robert Israel, Jan 06 2017
  • Mathematica
    a[n_] := Count[Range[Prime[n]+1, Prime[n+1]-1], _?SquareFreeQ];
    Array[a, 100] (* Jean-François Alcover, Feb 28 2019 *)
    Count[Range[#[[1]]+1,#[[2]]-1],?(SquareFreeQ[#]&)]&/@Partition[ Prime[ Range[120]],2,1] (* _Harvey P. Dale, Oct 14 2021 *)
  • PARI
    { n=0; q=2; forprime (p=3, prime(1001), a=0; for (i=q+1, p-1, a+=issquarefree(i)); write("b061398.txt", n++, " ", a); q=p ) } \\ Harry J. Smith, Jul 22 2009
    
  • PARI
    a(n) = my(pp=prime(n)+1); sum(k=pp, nextprime(pp)-1, issquarefree(k)); \\ Michel Marcus, Feb 28 2019
    
  • Python
    from math import isqrt
    from sympy import mobius, prime, nextprime
    def A061398(n):
        p = prime(n)
        q = nextprime(p)
        r = isqrt(p-1)+1
        return sum(mobius(k)*((q-1)//k**2) for k in range(r,isqrt(q-1)+1))+sum(mobius(k)*((q-1)//k**2-(p-1)//k**2) for k in range(1,r))-1 # Chai Wah Wu, Jun 01 2024

Formula

a(n) = A013928(A000040(n+1)) - A013928(A000040(n)) - 1. - Robert Israel, Jan 06 2017
a(n) = A373198(n) - 1. - Gus Wiseman, Nov 06 2024

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
Showing 1-10 of 123 results. Next