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

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

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

A376593 Second differences of consecutive nonsquarefree numbers (A013929). First differences of A078147.

Original entry on oeis.org

-3, 2, 1, -2, 0, 2, -3, 1, -1, 3, 0, 0, 0, -3, 2, -2, 0, 1, 0, 0, 2, -1, -2, 3, 0, -1, -2, 3, -3, 2, 1, -2, 0, 2, -2, -1, 0, 3, 0, 0, 0, -3, 2, -2, 2, -2, 0, 1, 2, -1, -2, 3, 0, -1, -2, 1, 0, -1, 2, 1, -2, 0, 2, -3, 1, -1, 2, -2, 3, 0, 0, -3, 2, 1, -2, 0, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2024

Keywords

Comments

The range is {-3, -2, -1, 0, 1, 2, 3}.

Examples

			The nonsquarefree numbers (A013929) are:
  4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, 52, ...
with first differences (A078147):
  4, 1, 3, 4, 2, 2, 4, 1, 2, 1, 4, 4, 4, 4, 1, 3, 1, 1, 2, 2, 2, 4, 3, 1, 4, 4, ...
with first differences (A376593):
  -3, 2, 1, -2, 0, 2, -3, 1, -1, 3, 0, 0, 0, -3, 2, -2, 0, 1, 0, 0, 2, -1, -2, ...
		

Crossrefs

The version for A000002 is A376604, first differences of A054354.
The first differences were A078147.
Zeros are A376594, complement A376595.
A000040 lists the prime numbers, differences A001223.
A005117 lists squarefree numbers, differences A076259.
A064113 lists positions of adjacent equal prime gaps.
A114374 counts partitions into nonsquarefree numbers.
A246655 lists prime-powers exclusive, inclusive A000961.
A333254 lists run-lengths of differences between consecutive primes.
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376596 (prime-power inclusive), A376599 (non-prime-power inclusive).
For nonsquarefree numbers: A013929 (terms), A078147 (first differences), A376594 (inflections and undulations), A376595 (nonzero curvature).

Programs

  • Mathematica
    Differences[Select[Range[100],!SquareFreeQ[#]&],2]
  • Python
    from math import isqrt
    from sympy import mobius, factorint
    def A376593(n):
        def f(x): return n+sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        k = next(i for i in range(1,5) if any(d>1 for d in factorint(m+i).values()))
        return next(i for i in range(1-k,5-k) if any(d>1 for d in factorint(m+(k<<1)+i).values())) # Chai Wah Wu, Oct 02 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

A073445 Second differences of A002808, the sequence of composites.

Original entry on oeis.org

0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, 0, 1, 0, -1, 0, 0, 0, 1, -1, 0, 1, -1, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0
Offset: 1

Views

Author

Labos Elemer, Aug 01 2002

Keywords

Examples

			From _Gus Wiseman_, Oct 10 2024: (Start)
The composite numbers (A002808) are:
  4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
  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, ...
with first differences (A073445):
  0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, ...
(End)
		

Crossrefs

Also first differences of A054546.
For first differences we had A073783 (ones A375929), run-lengths A376680.
Positions of zeros are A376602.
Positions of nonzeros are A376603.
Positions of ones are A376651, negative-ones A376652.
A002808 lists the composite numbers.
A064113 lists positions of adjacent equal prime gaps.
A333254 gives run-lengths of differences between consecutive primes.
Other second differences: A036263 (prime), A376590 (squarefree), A376596 (prime-power), A376604 (Kolakoski).

Programs

  • Haskell
    a073445 n = a073445_list !! (n-1)
    a073445_list = zipWith (-) (tail a073783_list) a073783_list
    -- Reinhard Zumkeller, Jan 10 2013
    
  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x]; Table[c[w+2]-2*c[w+1]+c[w], {w, 200}]
    (* second program *)
    Differences[Select[Range[100],CompositeQ],2] (* Gus Wiseman, Oct 08 2024 *)
  • Python
    from sympy import primepi
    def A073445(n):
        def iterfun(f,n=0):
            m, k = n, f(n)
            while m != k: m, k = k, f(k)
            return m
        return (a:=iterfun(f:=lambda x:n+primepi(x)+1,n))-((b:=iterfun(lambda x:f(x)+1,a))<<1)+iterfun(lambda x:f(x)+2,b) # Chai Wah Wu, Oct 03 2024

Formula

a(n) = c(n+2)-2*c(n+1)+c(n), where c(n) = A002808(n).
a(n) = A073783(n+1) - A073783(n). - Reinhard Zumkeller, Jan 10 2013

A068361 Numbers n such that the number of squarefree numbers between prime(n) and prime(n+1) = prime(n+1)-prime(n)-1.

Original entry on oeis.org

1, 3, 10, 13, 26, 33, 60, 89, 104, 113, 116, 142, 148, 201, 209, 212, 234, 265, 268, 288, 313, 320, 332, 343, 353, 384, 398, 408, 477, 484, 498, 542, 545, 551, 577, 581, 601, 625, 636, 671, 719, 723, 726, 745, 794, 805, 815, 862, 864, 884, 944, 964, 995, 1054
Offset: 1

Views

Author

Benoit Cloitre, Feb 28 2002

Keywords

Comments

Also numbers k such that all numbers from prime(k) to prime(k+1) are squarefree. All such primes are twins, so this is a subset of A029707. The other twin primes are A061368. - Gus Wiseman, Dec 11 2024

Crossrefs

A subset of A029707 (lesser index of twin primes).
Prime index of each (prime) term of A061351.
Positions of zeros in A061399.
For perfect power instead of squarefree we have A377436, zeros of A377432.
Positions of zeros in A377784.
The rest of the twin primes are at A378620, indices of A061368.
A000040 lists the primes, differences A001223, (run-lengths A333254, A373821).
A005117 lists the squarefree numbers, differences A076259.
A006562 finds balanced primes.
A013929 lists the nonsquarefree numbers, differences A078147.
A014574 is the intersection of A006093 and A008864.
A038664 locates the first prime gap of size 2n.
A046933 counts composite numbers between primes.
A061398 counts squarefree numbers between primes, zeros A068360.
A120327 gives the least nonsquarefree number >= n.

Programs

  • Mathematica
    Select[Range[100],And@@SquareFreeQ/@Range[Prime[#],Prime[#+1]]&] (* Gus Wiseman, Dec 11 2024 *)
  • PARI
    isok(n) = for (k=prime(n)+1, prime(n+1)-1, if (!issquarefree(k), return (0))); 1; \\ Michel Marcus, Apr 29 2016

Formula

n such that A061398(n) = prime(n+1)-prime(n)-1.
prime(a(n)) = A061351(n). - Gus Wiseman, Dec 11 2024

A376596 Second differences of consecutive prime-powers inclusive (A000961). First differences of A057820.

Original entry on oeis.org

0, 0, 0, 1, -1, 0, 1, 0, 1, -2, 1, 2, -2, 0, 0, 0, -1, 4, -1, -2, 2, -2, 2, 2, -4, 1, 0, 1, -2, 4, -4, 0, 4, 2, -4, -2, 2, -2, 2, 4, -4, -2, -1, 2, 3, -4, 8, -8, 4, 0, -2, -2, 2, 2, -4, 8, -8, 2, -2, 10, 0, -8, -2, 2, 2, -4, 0, 6, -3, -4, 5, 0, -4, 4, -2, -2
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2024

Keywords

Comments

For the exclusive version, shift left once.

Examples

			The prime-powers inclusive (A000961) are:
  1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, ...
with first differences (A057820):
  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, ...
with first differences (A376596):
  0, 0, 0, 1, -1, 0, 1, 0, 1, -2, 1, 2, -2, 0, 0, 0, -1, 4, -1, -2, 2, -2, 2, 2, ...
		

Crossrefs

The version for A000002 is A376604, first differences of A054354.
For first differences we had A057820, sorted firsts A376340(n)+1 (except first term).
Positions of zeros are A376597, complement A376598.
Sorted positions of first appearances are A376653, exclusive A376654.
A000961 lists prime-powers inclusive, exclusive A246655.
A001597 lists perfect-powers, complement A007916.
A023893 and A023894 count integer partitions into prime-powers, factorizations A000688.
A064113 lists positions of adjacent equal prime gaps.
For prime-powers inclusive: A057820 (first differences), A376597 (inflections and undulations), A376598 (nonzero curvature).
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376599 (non-prime-power).

Programs

  • Mathematica
    Differences[Select[Range[1000],#==1||PrimePowerQ[#]&],2]
  • Python
    from sympy import primepi, integer_nthroot
    def A376596(n):
        def iterfun(f,n=0):
            m, k = n, f(n)
            while m != k: m, k = k, f(k)
            return m
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        return (a:=iterfun(f,n))-((b:=iterfun(lambda x:f(x)+1,a))<<1)+iterfun(lambda x:f(x)+2,b) # Chai Wah Wu, Oct 02 2024

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