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-6 of 6 results.

A378251 Number of primes between consecutive perfect powers, zeros omitted.

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 1, 3, 5, 5, 3, 1, 5, 1, 7, 5, 2, 4, 6, 7, 7, 5, 2, 6, 9, 8, 7, 8, 9, 8, 8, 6, 4, 9, 10, 9, 10, 7, 2, 9, 12, 11, 12, 6, 5, 9, 12, 11, 3, 10, 8, 2, 13, 15, 10, 11, 15, 7, 9, 12, 13, 11, 12, 17, 2, 11, 16, 16, 13, 17, 15, 14, 16, 15
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2024

Keywords

Comments

First differences of A377283 and A378365. Run-lengths of A378035 and A378249.
Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			The first number line below shows the perfect powers. The second shows each prime. To get a(n) we count the primes between consecutive perfect powers, skipping the cases where there are none.
-1-----4-------8-9------------16----------------25--27--------32------36----
===2=3===5===7======11==13======17==19======23==========29==31==========37==
		

Crossrefs

Same as A080769 with 0's removed (which were at positions A274605).
First differences of A377283 and A378365 (union of A378356).
Run-lengths of A378035 (union A378253) and A378249 (union A378250).
The version for nonprime prime powers is A378373, with zeros A067871.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, run-lengths of A377468.
A007916 lists the non-perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.

Programs

  • Maple
    N:= 10^6: # to use perfect powers up to N
    PP:= {1,seq(seq(i^j,j=2..ilog[i](N)),i=2..isqrt(N))}:
    PP:= sort(convert(PP,list)):
    M:= map(numtheory:-pi, PP):
    subs(0=NULL, M[2..-1]-M[1..-2]): # Robert Israel, Jan 23 2025
  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Length/@Split[Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,100}]]

A379300 Number of prime indices of n that are composite.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Dec 25 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The prime indices of 39 are {2,6}, so a(39) = 1.
The prime indices of 70 are {1,3,4}, so a(70) = 1.
The prime indices of 98 are {1,4,4}, so a(98) = 2.
The prime indices of 294 are {1,2,4,4}, a(294) = 2.
The prime indices of 1911 are {2,4,4,6}, so a(1911) = 3.
The prime indices of 2548 are {1,1,4,4,6}, so a(2548) = 3.
		

Crossrefs

Positions of first appearances are A000420.
Positions of zero are A302540, counted by A034891 (strict A036497).
Positions of one are A379301, counted by A379302 (strict A379303).
A000040 lists the prime numbers, differences A001223.
A002808 lists the composite numbers, nonprimes A018252, differences A073783 or A065310.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A066247 is the characteristic function for the composite numbers.
A377033 gives k-th differences of composite numbers, see A073445, A377034-A377037.
Other counts of prime indices:
- A087436 postpositive, see A038550.
- A330944 nonprime, see A002095, A096258, A320628, A330945.
- A379306 squarefree, see A302478, A379308, A379309, A379316.
- A379310 nonsquarefree, see A114374, A256012, A379307.
- A379311 old prime, see A379312-A379315.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[prix[n],CompositeQ]],{n,100}]

Formula

Totally additive with a(prime(k)) = A066247(k).

A378369 Distance between n and the least nonsquarefree number >= n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 01 2024

Keywords

Comments

All terms are 0, 1, 2, or 3 (cf. A078147).

Crossrefs

Adding n to each term a(n) gives A120327.
Positions of 0 are A013929.
Positions of 1 are A373415.
Positions of 2 are A378458.
Positions of 3 are A007675.
Sequences obtained by adding n to each term are placed in parentheses below.
The version for primes is A007920 (A007918).
The version for perfect powers is A074984 (A377468).
The version for squarefree numbers is A081221 (A067535).
The version for non-perfect powers is A378357 (A378358).
The version for prime powers is A378370 (A000015).
The version for non prime powers is A378371 (A378372).
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A120992 gives run-lengths of squarefree numbers increasing by one.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,SquareFreeQ[#]&]-n,{n,100}]

A378456 Number of composite numbers between consecutive nonprime prime powers (exclusive).

Original entry on oeis.org

1, 0, 4, 5, 1, 2, 12, 11, 12, 31, 3, 1, 32, 59, 11, 25, 46, 13, 125, 14, 80, 88, 94, 103, 52, 261, 35, 267, 147, 172, 120, 9, 9, 163, 355, 279, 313, 207, 329, 347, 376, 108, 257, 805, 283, 262, 25, 917, 242, 1081, 702, 365, 752, 389, 251, 535, 1679, 877, 447
Offset: 1

Views

Author

Gus Wiseman, Nov 30 2024

Keywords

Comments

The inclusive version is a(n) + 2.
Nonprime prime powers (A246547) begin: 4, 8, 9, 16, 25, 27, 32, 49, ...

Examples

			The initial terms count the following composite numbers:
  {6}, {}, {10,12,14,15}, {18,20,21,22,24}, {26}, {28,30}, ...
The composite numbers for a(77) = 6 together with their prime indices are the following. We have also shown the nonprime prime powers before and after:
  32761: {42,42}
  32762: {1,1900}
  32763: {2,19,38}
  32764: {1,1,1028}
  32765: {3,847}
  32766: {1,2,14,31}
  32767: {4,11,36}
  32768: {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
		

Crossrefs

For prime instead of composite we have A067871.
For nonsquarefree numbers we have A378373, for primes A236575.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A002808 lists the composite numbers.
A031218 gives the greatest prime-power <= n.
A046933 counts composite numbers between primes.
A053707 gives first differences of nonprime prime powers.
A080101 = A366833 - 1 counts prime powers between primes.
A246655 lists the prime-powers not including 1, complement A361102.
A345531 gives the nearest prime power after prime(n) + 1, difference A377281.
Cf. A377286, A377287, A377288 (primes A053706).

Programs

  • Mathematica
    nn=1000;
    v=Select[Range[nn],PrimePowerQ[#]&&!PrimeQ[#]&];
    Table[Length[Select[Range[v[[i]]+1,v[[i+1]]-1],CompositeQ]],{i,Length[v]-1}]

A378458 Squarefree numbers k such that k + 1 is squarefree but k + 2 is not.

Original entry on oeis.org

2, 6, 10, 14, 22, 30, 34, 38, 42, 46, 58, 61, 66, 70, 73, 78, 82, 86, 94, 102, 106, 110, 114, 118, 122, 130, 133, 138, 142, 145, 154, 158, 166, 173, 178, 182, 186, 190, 194, 202, 205, 210, 214, 218, 222, 226, 230, 238, 246, 254, 258, 262, 266, 273, 277, 282
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2024

Keywords

Comments

These are the positions of 2 in A378369 (difference between n and the next nonsquarefree number).
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) - Product_{p prime} (1 - 3/p^2) = A065474 - A206256 = 0.19714711803343537224... . - Amiram Eldar, Dec 03 2024

Crossrefs

Complement of A007675 within A007674.
The version for prime power instead of nonsquarefree is a subset of A006549.
Another variation is A073247.
The version for nonprime instead of squarefree is A179384.
Positions of 0 in A378369 are A013929.
Positions of 1 in A378369 are A373415.
Positions of 2 in A378369 are A378458 (this).
Positions of 3 in A378369 are A007675.
A000961 lists the powers of primes, differences A057820.
A120327 gives the least nonsquarefree number >= n.
A378373 counts composite numbers between nonsquarefree numbers.

Programs

  • Mathematica
    Select[Range[100],NestWhile[#+1&,#,SquareFreeQ[#]&]==#+2&]
  • PARI
    list(lim) = my(q1 = 1, q2 = 1, q3); for(k = 3, lim, q3 = issquarefree(k); if(q1 && q2 &&!q3, print1(k-2, ", ")); q1 = q2; q2 = q3); \\ Amiram Eldar, Dec 03 2024

A378614 Number of composite numbers (A002808) between consecutive perfect powers (A001597), exclusive.

Original entry on oeis.org

0, 1, 0, 4, 5, 1, 2, 3, 8, 11, 12, 15, 15, 3, 1, 12, 19, 21, 16, 7, 12, 11, 25, 29, 16, 13, 32, 33, 35, 22, 14, 40, 39, 42, 45, 46, 47, 50, 52, 32, 19, 55, 56, 59, 60, 27, 35, 65, 64, 67, 68, 40, 30, 75, 74, 77, 19, 57, 62, 9, 9, 81, 81, 88, 89, 87, 32, 55, 94
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2024

Keywords

Comments

The inclusive version is a(n) + 2.

Examples

			The composite numbers counted by a(n) cover A106543 with the following disjoint sets:
  .
  6
  .
  10 12 14 15
  18 20 21 22 24
  26
  28 30
  33 34 35
  38 39 40 42 44 45 46 48
  50 51 52 54 55 56 57 58 60 62 63
		

Crossrefs

For prime instead of perfect power we have A046933.
For prime instead of composite we have A080769.
For nonsquarefree instead of perfect power we have A378373, for primes A236575.
For nonprime prime power instead of perfect power we have A378456.
A001597 lists the perfect powers, differences A053289.
A002808 lists the composite numbers.
A007916 lists the non perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A106543 lists the composite non perfect powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.
A378365 gives the least prime > each perfect power, opposite A377283.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    v=Select[Range[100],perpowQ[#]&];
    Table[Length[Select[Range[v[[i]]+1,v[[i+1]]-1],CompositeQ]],{i,Length[v]-1}]
  • Python
    from sympy import mobius, integer_nthroot, primepi
    def A378614(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        return -(a:=bisection(f,n,n))+(b:=bisection(lambda x:f(x)+1,a+1,a+1))-primepi(b)+primepi(a)-1 # Chai Wah Wu, Dec 03 2024
Showing 1-6 of 6 results.