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 36 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[[#]]]&]

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.

A027833 Distances between successive 2's in sequence A001223 of differences between consecutive primes.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, 4, 3, 5, 3, 4, 5, 12, 2, 6, 9, 6, 5, 4, 3, 4, 20, 2, 2, 4, 4, 19, 2, 3, 2, 4, 8, 11, 5, 3, 3, 3, 10, 5, 4, 2, 17, 3, 6, 3, 3, 9, 9, 2, 6, 2, 6, 5, 6, 2, 3, 2, 3, 9, 4, 7, 3, 7, 20, 4, 7, 6, 5, 3, 7, 3, 20, 2, 14, 4, 10, 2, 3, 6, 4, 2, 2, 7, 2, 6, 3
Offset: 1

Views

Author

Jean-Marc MALASOMA (Malasoma(AT)entpe.fr)

Keywords

Comments

a(n) = number of primes p such that A014574(n) < p < A014574(n+1). - Thomas Ordowski, Jul 20 2012
Conjecture: a(n) < log(A014574(n))^2. - Thomas Ordowski, Jul 21 2012
Conjecture: All positive integers are represented in this sequence. This is verified up to 184, by searching up to prime indexes of ~128000000. The rate of filling-in the smallest remaining gap among the integers, and the growth in the maximum value found, both slow down considerably relative to a fixed quantity of twin prime incidences examined in each pass. The maximum value found was 237. - Richard R. Forberg, Jul 28 2016
All positive integers below 312 are in this sequence. - Charles R Greathouse IV, Aug 01 2016
From Gus Wiseman, Jun 11 2024: (Start)
Also the length of the n-th maximal antirun of prime numbers > 3, where an antirun is an interval of positions at which consecutive terms differ by more than 2. These 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
(End)

Crossrefs

First differences of A029707 and A155752 = A029707 - 1. M. F. Hasler, Jul 24 2012
Positions of first appearances are A373401, sorted A373402.
Functional neighbors: A001359, A006512, A251092 or A175632, A373127 (firsts A373128, sorted A373200), A373403, A373405, A373409.
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

  • Maple
    A027833 := proc(n)
        local plow,phigh ;
        phigh := A001359(n+1) ;
        plow := A001359(n) ;
        numtheory[pi](phigh)-numtheory[pi](plow) ;
    end proc:
    seq(A027833(n),n=1..100) ; # R. J. Mathar, Jan 20 2025
  • Mathematica
    Differences[Flatten[Position[Differences[Prime[Range[500]]],2]]] (* Harvey P. Dale, Nov 17 2018 *)
    Length/@Split[Select[Range[4,10000],PrimeQ[#]&],#1+2!=#2&]//Most (* Gus Wiseman, Jun 11 2024 *)
  • PARI
    n=1; p=5; forprime(q=7,1e3, if(q-p==2, print1(n", "); n=1, n++); p=q) \\ Charles R Greathouse IV, Aug 01 2016
  • Sage
    def A027833(n) :
       a = [ ]
       st = 2
       for i in (3..n) :
          if (nth_prime(i+1)-nth_prime(i) == 2) :
             a.append(i-st)
             st = i
       return(a)
    A027833(496) # Jani Melik, May 15 2014
    

A375708 First differences of non-prime-powers (exclusive, so 1 is not a prime-power).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Aug 31 2024

Keywords

Comments

Non-prime-powers (exclusive) are listed by A361102.
Warning: For this sequence, 1 is not a prime-power but is a non-prime-power.

Examples

			The 6th non-prime-power (exclusive) is 15, and the 7th is 18, so a(6) = 3.
		

Crossrefs

For prime-powers (A000961, A246655) we have A057820, gaps A093555.
For perfect powers (A001597) we have A053289.
For nonprime numbers (A002808) we have A073783.
For squarefree numbers (A005117) we have A076259.
First differences of A361102, inclusive A024619.
Positions of 1's are A375713.
If 1 is considered a prime power we have A375735.
Runs of non-prime-powers:
- length: A110969
- first: A373676
- last: A373677
- sum: A373678
A000040 lists all of the primes, differences A001223.
A007916 lists non-perfect-powers, differences A375706.
A013929 lists the nonsquarefree numbers, differences A078147.
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Prime-power antiruns: A373576, min A120430, max A006549, length A373671.
Non-prime-power antiruns: A373679, min A373575, max A255346, length A373672.

Programs

  • Mathematica
    Differences[Select[Range[100],!PrimePowerQ[#]&]]
  • Python
    from itertools import count
    from sympy import primepi, integer_nthroot, primefactors
    def A375708(n):
        def f(x): return int(n+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)
        return next(i for i in count(m+1) if len(primefactors(i))>1)-m # Chai Wah Wu, Sep 09 2024

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

A375735 First differences of non-prime-powers (inclusive).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 04 2024

Keywords

Comments

Inclusive means 1 is a prime-power but not a non-prime-power.
Non-prime-powers (inclusive) are listed by A024619.

Examples

			The 5th non-prime-power (inclusive) is 15, and the 6th is 18, so a(5) = 3.
		

Crossrefs

For perfect powers (A001597) we have the latter terms of A053289.
For nonprime numbers (A002808) we have the latter terms of A073783.
For squarefree numbers (A005117) we have the latter terms of A076259.
First differences of A024619.
For prime-powers (A246655) we have the latter terms of A057820.
Essentially the same as the exclusive version, A375708.
Positions of 1's are A375713(n) - 1.
For runs of non-prime-powers:
- length: A110969
- first: A373676
- last: A373677
- sum: A373678
A000040 lists all of the primes, first differences A001223.
A000961 lists prime-powers (inclusive).
A007916 lists non-perfect-powers, first differences A375706.
A013929 lists the nonsquarefree numbers, first differences A078147.
A246655 lists prime-powers (exclusive).
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Prime-power anti-runs: A373576, min A120430, max A006549, length A373671.
Non-prime-power anti-runs: A373679, min A373575, max A255346, len A373672.

Programs

  • Mathematica
    Differences[Select[Range[2,100],!PrimePowerQ[#]&]]
  • Python
    from itertools import count
    from sympy import primepi, integer_nthroot, primefactors
    def A375735(n):
        def f(x): return int(n+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)
        return next(i for i in count(m+1) if len(primefactors(i))>1)-m # Chai Wah Wu, Sep 10 2024

A065310 Number of occurrences of n-th prime in A065308, where A065308(j) = prime(j - pi(j)).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Oct 29 2001

Keywords

Comments

Seems identical to A054546. Each odd prime arises once or twice!?
First differences of A018252 (positive nonprime numbers). Including 0 gives A054546. Removing 1 gives A073783. - Gus Wiseman, Sep 15 2024

Crossrefs

For twin 2's see A169643.
Positions of 1's are A375926, complement A014689 (except first term).
Other families of numbers and their first-differences:
For prime numbers (A000040) we have A001223.
For composite numbers (A002808) we have A073783.
For nonprime numbers (A018252) we have A065310 (this).
For perfect powers (A001597) we have A053289.
For non-perfect-powers (A007916) we have A375706.
For squarefree numbers (A005117) we have A076259.
For nonsquarefree numbers (A013929) we have A078147.
For prime-powers inclusive (A000961) we have A057820.
For prime-powers exclusive (A246655) we have A057820(>1).
For non-prime-powers inclusive (A024619) we have A375735.
For non-prime-powers exclusive (A361102) we have A375708.

Programs

  • Mathematica
    t=Table[Prime[w-PrimePi[w]], {w, a, b}] Table[Count[t, Prime[n]], {n, c, d}]
    Differences[Select[Range[100],!PrimeQ[#]&]] (* Gus Wiseman, Sep 15 2024 *)
  • PARI
    { p=1; f=2; m=1; for (n=1, 1000, a=0; p=nextprime(p + 1); while (p==f, a++; m++; f=prime(m - primepi(m))); write("b065310.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 16 2009

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