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

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

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

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)).

A373575 Numbers k such that k and k-1 both have at least two distinct prime factors. First element of the n-th maximal antirun of non-prime-powers.

Original entry on oeis.org

1, 15, 21, 22, 34, 35, 36, 39, 40, 45, 46, 51, 52, 55, 56, 57, 58, 63, 66, 69, 70, 75, 76, 77, 78, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 100, 105, 106, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 130, 133, 134, 135, 136, 141, 142, 143, 144, 145
Offset: 1

Views

Author

Gus Wiseman, Jun 18 2024

Keywords

Comments

The last element of the same antirun is given by A255346.
An antirun of a sequence (in this case A361102) 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

Runs of prime-powers:
- length A174965
- min A373673
- max A373674
- sum A373675
Runs of non-prime-powers:
- length A110969
- min A373676
- max A373677
- sum A373678
Antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
Antiruns of non-prime-powers:
- length A373672
- min A373575 (this sequence)
- max A255346
- sum 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
    Select[Range[100],!PrimePowerQ[#]&&!PrimePowerQ[#-1]&]
    Join[{1},SequencePosition[Table[If[PrimeNu[n]>1,1,0],{n,150}],{1,1}][[;;,2]]] (* Harvey P. Dale, Feb 23 2025 *)

A373673 First element of each maximal run of powers of primes (including 1).

Original entry on oeis.org

1, 7, 11, 13, 16, 19, 23, 25, 27, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Gus Wiseman, Jun 15 2024

Keywords

Comments

A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The last element of the same run is A373674.
Consists of all powers of primes k such that k-1 is not a power of primes.

Examples

			The maximal runs of powers of primes begin:
   1   2   3   4   5
   7   8   9
  11
  13
  16  17
  19
  23
  25
  27
  29
  31  32
  37
  41
  43
  47
  49
		

Crossrefs

For composite antiruns we have A005381, max A068780, length A373403.
For prime antiruns we have A006512, max A001359, length A027833.
For composite runs we have A008864, max A006093, length A176246.
For prime runs we have A025584, max A067774, length A251092 or A175632.
For runs of prime-powers:
- length A174965
- min A373673 (this sequence)
- max A373674
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes (A246655 if not including 1).
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    pripow[n_]:=n==1||PrimePowerQ[n];
    Min/@Split[Select[Range[100],pripow],#1+1==#2&]//Most

A373676 First element of each maximal run of non-prime-powers.

Original entry on oeis.org

1, 6, 10, 12, 14, 18, 20, 24, 26, 28, 30, 33, 38, 42, 44, 48, 50, 54, 60, 62, 65, 68, 72, 74, 80, 82, 84, 90, 98, 102, 104, 108, 110, 114, 122, 126, 129, 132, 138, 140, 150, 152, 158, 164, 168, 170, 174, 180, 182, 192, 194, 198, 200, 212, 224, 228, 230, 234
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2024

Keywords

Comments

We consider 1 to be a power of a prime and a non-prime-power, but not a prime-power.
A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The last element of the same run is A373677.
Consists of 1 and all non-prime-powers k such that k-1 is a power of a prime.

Examples

			The maximal runs 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  51  52
  54  55  56  57  58
  60
		

Crossrefs

See link for prime, composite, squarefree, and nonsquarefree runs/antiruns.
For runs of powers of primes:
- length A174965
- min A373673
- max A373674
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676 (this sequence)
- max A373677
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes. A246655 is just prime-powers so lacks 1.
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    Select[Range[100],#==1||!PrimePowerQ[#]&&PrimePowerQ[#-1]&]

A373677 Last element of each maximal run of non-prime-powers.

Original entry on oeis.org

1, 6, 10, 12, 15, 18, 22, 24, 26, 28, 30, 36, 40, 42, 46, 48, 52, 58, 60, 63, 66, 70, 72, 78, 80, 82, 88, 96, 100, 102, 106, 108, 112, 120, 124, 126, 130, 136, 138, 148, 150, 156, 162, 166, 168, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2024

Keywords

Comments

We consider 1 to be a power of a prime and a non-prime-power, but not a prime-power.
A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The first element of the same run is A373676.
Consists of all non-prime-powers k such that k+1 is a prime-power.

Examples

			The maximal runs 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  51  52
  54  55  56  57  58
  60
		

Crossrefs

See link for prime, composite, squarefree, and nonsquarefree runs/antiruns.
For runs of powers of primes:
- length A174965
- min A373673
- max A373674
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677 (this sequence)
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes. A246655 is just prime-powers so lacks 1.
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    Select[Range[100],!PrimePowerQ[#]&&PrimePowerQ[#+1]&]

A373674 Last element of each maximal run of powers of primes (including 1).

Original entry on oeis.org

5, 9, 11, 13, 17, 19, 23, 25, 27, 29, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2024

Keywords

Comments

A run of a sequence (in this case A000961) is an interval of positions at which consecutive terms differ by one.
The first element of the same run is A373673.
Consists of all powers of primes k such that k+1 is not a power of primes.

Examples

			The maximal runs of powers of primes begin:
   1   2   3   4   5
   7   8   9
  11
  13
  16  17
  19
  23
  25
  27
  29
  31  32
  37
  41
  43
  47
  49
		

Crossrefs

For prime antiruns we have A001359, min A006512, length A027833.
For composite runs we have A006093, min A008864, length A176246.
For prime runs we have A067774, min A025584, length A251092 or A175632.
For squarefree runs we have A373415, min A072284, length A120992.
For nonsquarefree runs we have min A053806, length A053797.
For runs of prime-powers:
- length A174965
- min A373673
- max A373674 (this sequence)
- sum A373675
For runs of non-prime-powers:
- length A110969 (firsts A373669, sorted A373670)
- min A373676
- max A373677
- sum A373678
For antiruns of prime-powers:
- length A373671
- min A120430
- max A006549
- sum A373576
For antiruns of non-prime-powers:
- length A373672
- min A373575
- max A255346
- sum A373679
A000961 lists all powers of primes (A246655 if not including 1).
A025528 counts prime-powers up to n.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A361102 lists all non-prime-powers (A024619 if not including 1).

Programs

  • Mathematica
    pripow[n_]:=n==1||PrimePowerQ[n];
    Max/@Split[Select[Range[nn],pripow],#1+1==#2&]//Most

A373669 Least k such that the k-th maximal run of non-prime-powers has length n. Position of first appearance of n in A110969, and the sequence ends if there is none.

Original entry on oeis.org

1, 5, 7, 12, 18, 190, 28, 109, 40, 28195574, 53
Offset: 1

Views

Author

Gus Wiseman, Jun 14 2024

Keywords

Comments

A run of a sequence (in this case A361102) is an interval of positions at which consecutive terms differ by one.
Are there only 9 terms?
From David A. Corneth, Jun 14 2024: (Start)
No. a(10) exists.
Between the prime 144115188075855859 and 144115188075855872 = 2^57 there are 12 non-prime-powers so a(12) exists. (End)

Examples

			The maximal runs 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  51  52
  54  55  56  57  58
  60
		

Crossrefs

For composite runs we have A073051, sorted A373400, firsts of A176246.
For squarefree runs we have firsts of A120992.
For prime-powers runs we have firsts of A174965.
For prime runs we have firsts of A251092 or A175632.
For squarefree antiruns we have A373128, firsts of A373127.
For nonsquarefree runs we have A373199, firsts of A053797.
The sorted version is A373670.
For antiruns we have firsts of A373672.
For runs of non-prime-powers:
- length A110969
- min A373676
- max A373677
- sum A373678
A000961 lists the powers of primes (including 1).
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A361102 lists the non-prime-powers, without 1 A024619.

Programs

  • Mathematica
    q=Length/@Split[Select[Range[10000],!PrimePowerQ[#]&],#1+1==#2&]//Most;
    spna[y_]:=Max@@Select[Range[Length[y]],SubsetQ[y,Range[#1]]&];
    Table[Position[q,k][[1,1]],{k,spna[q]}]
Showing 1-10 of 11 results. Next