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 23 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

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

A373576 Sums of maximal antiruns of prime-powers.

Original entry on oeis.org

2, 3, 4, 12, 8, 49, 171, 2032, 5157, 3997521, 199713082, 561678378, 10122001905, 109934112352390774
Offset: 1

Views

Author

Gus Wiseman, Jun 17 2024

Keywords

Comments

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

Examples

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

Crossrefs

See link for composite, prime, nonsquarefree, and squarefree runs/antiruns.
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Non-prime-power runs: A373678, min A373676, max A373677, length A110969.
Prime-power antiruns: A373576 (this sequence), min A120430, max A006549, length A373671.
Non-prime-power antiruns: A373679, min A373575, max A255346, length A373672.
A000040 lists the primes, differences A001223.
A000961 lists all powers of primes. A246655 lists just prime-powers.
A025528 counts prime-powers up to n.
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
    Total/@Split[Select[Range[1000],PrimePowerQ],#1+1!=#2&]//Most

Extensions

a(14) from Giorgos Kalogeropoulos, Jun 18 2024

A373679 Sums of maximal antiruns of non-prime-powers.

Original entry on oeis.org

43, 53, 21, 163, 34, 35, 74, 39, 126, 45, 144, 51, 106, 55, 56, 57, 180, 128, 134, 69, 216, 75, 76, 77, 324, 85, 86, 87, 178, 91, 92, 93, 94, 95, 194, 99, 306, 105, 324, 111, 226, 115, 116, 117, 118, 119, 242, 123, 379, 262, 133, 134, 135, 414, 141, 142, 143
Offset: 1

Views

Author

Gus Wiseman, Jun 17 2024

Keywords

Comments

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
  51
  52  54
  55
  56
  57
  58  60  62
  63  65
		

Crossrefs

See link for composite, prime, nonsquarefree, and squarefree runs/antiruns.
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Non-prime-power runs: A373678, min A373676, max A373677, length A110969.
Prime-power antiruns: A373576, min A120430, max A006549, length A373671.
Non-prime-power antiruns: A373679 (this sequence), min A373575, max A255346, length A373672.
A000040 lists the primes, differences A001223.
A000961 lists all powers of primes. A246655 lists just prime-powers.
A025528 counts prime-powers up to n.
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
    Total/@Split[Select[Range[100],!PrimePowerQ[#]&],#1+1!=#2&]//Most

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]&]
Showing 1-10 of 23 results. Next