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

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

A376340 Sorted positions of first appearances in A057820, the sequence of first differences of prime-powers.

Original entry on oeis.org

1, 4, 9, 12, 18, 24, 34, 47, 60, 79, 117, 178, 198, 206, 215, 244, 311, 402, 465, 614, 782, 1078, 1109, 1234, 1890, 1939, 1961, 2256, 2290, 3149, 3377, 3460, 3502, 3722, 3871, 4604, 4694, 6634, 8073, 8131, 8793, 12370, 12661, 14482, 14990, 15912, 17140, 19166
Offset: 1

Views

Author

Gus Wiseman, Sep 22 2024

Keywords

Examples

			The terms together with their prime indices begin:
     1: {}
     4: {1,1}
     9: {2,2}
    12: {1,1,2}
    18: {1,2,2}
    24: {1,1,1,2}
    34: {1,7}
    47: {15}
    60: {1,1,2,3}
    79: {22}
   117: {2,2,6}
   178: {1,24}
   198: {1,2,2,5}
   206: {1,27}
   215: {3,14}
   244: {1,1,18}
		

Crossrefs

For compression instead of sorted firsts we have A376308.
For run-lengths instead of sorted firsts we have A376309.
For run-sums instead of sorted firsts we have A376310.
The version for squarefree numbers is the unsorted version of A376311.
The unsorted version is A376341.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, first differences A057820.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259.
A024619 and A361102 list non-prime-powers, first differences A375708.
A116861 counts partitions by compressed sum, by compressed length A116608.

Programs

  • Mathematica
    q=Differences[Select[Range[100],PrimePowerQ]];
    Select[Range[Length[q]],!MemberQ[Take[q,#-1],q[[#]]]&]

A375734 Indices of consecutive prime-powers (exclusive) differing by 1. Positions of 1's in A057820.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 17, 43, 70, 1077, 6635, 12369, 43578, 105102700
Offset: 1

Views

Author

Gus Wiseman, Sep 04 2024

Keywords

Comments

The corresponding prime-powers A246655(a(n)) are given by A006549.
From A006549, it is not known whether this sequence is infinite.

Examples

			The fifth prime-power is 7 and the sixth is 8, so 5 is in the sequence.
		

Crossrefs

For nonprime numbers (A002808) we have A375926, differences A373403.
Positions of 1's in A057820.
First differences are A373671.
For nonsquarefree numbers we have A375709, differences A373409.
For non-prime-powers we have A375713.
For non-perfect-powers we have A375740.
For squarefree numbers we have A375927, differences A373127.
Prime-powers:
- terms: A000961, complement A024619.
- differences: A057820.
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708
- anti-runs: A373679, A373575, A255346, A373672
A000040 lists all of the primes, differences A001223.
A025528 counts prime-powers up to n.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],PrimePowerQ]],1]

Formula

Numbers k such that A246655(k+1) - A246655(k) = 1.
The inclusive version is a(n) + 1 shifted.

Extensions

a(14) from Amiram Eldar, Sep 24 2024

A376341 Position of first appearance of n in A057820, the sequence of first differences of prime-powers, or 0 if n does not appear.

Original entry on oeis.org

1, 5, 10, 13, 19, 25, 199, 35, 118, 48, 28195587, 61, 3745011205066703, 80, 6635, 312, 1079, 207, 3249254387600868788, 179, 43580, 216, 21151968922, 615, 762951923, 403, 1962, 466, 12371, 245, 1480223716, 783, 494890212533313, 1110, 2064590, 1235, 375744164943287809536
Offset: 1

Views

Author

Gus Wiseman, Sep 22 2024

Keywords

Comments

For odd n either a(n) or a(n)+1 is in A024622 (unless a(n) = 0), corresponding to cases where the smaller or the larger term in the pair of consecutive prime powers, respectively, is a power of 2. - Pontus von Brömssen, Sep 27 2024

Examples

			a(4) = 13, because the first occurrence of 4 in A057820 is at index 13. The corresponding first pair of consecutive prime powers with difference 4 is (19, 23), and a(4) = A025528(23) = 13.
a(61) = A024622(96), because the first pair of consecutive prime powers with difference 61 is (2^96, 2^96+61), and A025528(2^96+61) = A024622(96).
		

Crossrefs

For compression instead of first appearances we have A376308.
For run-lengths instead of first appearances we have A376309.
For run-sums instead of first appearances we have A376310.
For squarefree numbers instead of prime-powers we have A376311.
The sorted version is A376340.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, first differences A057820.
A024619 and A361102 list non-prime-powers, first differences A375708.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259.
A116861 counts partitions by compressed sum, by compressed length A116608.

Programs

  • Mathematica
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=Differences[Select[Range[100],#==1||PrimePowerQ[#]&]];
    Table[Position[q,k][[1,1]],{k,mnrm[q]}]

Formula

A057820(a(n)) = n whenever a(n) > 0. - Pontus von Brömssen, Sep 24 2024

Extensions

Definition modified by Pontus von Brömssen, Sep 26 2024
More terms from Pontus von Brömssen, Sep 27 2024

A053289 First differences of consecutive perfect powers (A001597).

Original entry on oeis.org

3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, 33, 35, 19, 18, 39, 41, 43, 28, 17, 47, 49, 51, 53, 55, 57, 59, 61, 39, 24, 65, 67, 69, 71, 35, 38, 75, 77, 79, 81, 47, 36, 85, 87, 89, 23, 68, 71, 10, 12, 95, 97, 99, 101, 103, 40, 65, 107, 109, 100
Offset: 1

Views

Author

Labos Elemer, Mar 03 2000

Keywords

Comments

Michel Waldschmidt writes: Conjecture 1.3 (Pillai). Let k be a positive integer. The equation x^p - y^q = k where the unknowns x, y, p and q take integer values, all >= 2, has only finitely many solutions (x,y,p,q). This means that in the increasing sequence of perfect powers [A001597] the difference between two consecutive terms [the present sequence] tends to infinity. It is not even known whether for, say, k=2, Pillai's equation has only finitely many solutions. A related open question is whether the number 6 occurs as a difference between two perfect powers. See Sierpiński [1970], problem 238a, p. 116. - Jonathan Vos Post, Feb 18 2008
Are there are any adjacent equal terms? - Gus Wiseman, Oct 08 2024

Examples

			Consecutive perfect powers are A001597(14) = 121, A001597(13) = 100, so a(13) = 121 - 100 = 21.
		

References

  • Wacław Sierpiński, 250 problems in elementary number theory, Modern Analytic and Computational Methods in Science and Mathematics, No. 26, American Elsevier, Warsaw, 1970, pp. 21, 115-116.
  • S. S. Pillai, On the equation 2^x - 3^y = 2^X - 3^Y, Bull, Calcutta Math. Soc. 37 (1945) 15-20.

Crossrefs

For non-perfect-powers (A007916) we have A375706.
The union is A023055.
For prime-powers (A000961 or A246655) we have A057820.
Sorted positions of first appearances are A376268, complement A376519.
For second differences we have A376559.
Ascending and descending points are A376560 and A376561.
A001597 lists perfect-powers.
A112344 counts integer partitions into perfect-powers, factorizations A294068.
A333254 gives run-lengths of differences between consecutive primes.

Programs

  • Mathematica
    Differences@ Select[Range@ 3200, # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &] (* Michael De Vlieger, Jun 30 2016, after Ant King at A001597 *)
  • Python
    from sympy import mobius, integer_nthroot
    def A053289(n):
        if n==1: return 3
        def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax)+1 >= kmax:
            kmax <<= 1
        rmin, rmax = 1, kmax
        while True:
            kmid = kmax+kmin>>1
            if f(kmid)+1 < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        while True:
            rmid = rmax+rmin>>1
            if f(rmid) < rmid:
                rmax = rmid
            else:
                rmin = rmid
            if rmax-rmin <= 1:
                break
        return kmax-rmax # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A001597(n+1) - A001597(n). - Jonathan Vos Post, Feb 18 2008
From Amiram Eldar, Jun 30 2023: (Start)
Formulas from Jakimczuk (2016):
Lim sup_{n->oo} a(n)/(2*n) = 1.
Lim inf_{n->oo} a(n)/(2*n)^(2/3 + eps) = 0. (End)
Can be obtained by inserting 0 between 3 and 6 in A375702 and then adding 1 to all terms. In particular, for n > 2, a(n+1) - 1 = A375702(n). - Gus Wiseman, Sep 14 2024

A174965 Length of the n-th run of consecutive terms in A000961.

Original entry on oeis.org

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

Views

Author

Pahikkala Jussi, Apr 02 2010

Keywords

Comments

Let b(n) be partial sums of this sequence, as b(0) = 0, b(n) = b(n-1) + a(n). Then 2's in this sequence occur at certain positions k so that A000961(b(k))-1 = one of the terms of A006549. E.g., a(6625) = 2, and b(6625) = 6637, with A000961(6637) = 65537, the end of 2-run (65536,65537) in A000961. (The start of that 2-run, 65536, is listed as A006549(12), and 12 = 6637-6625.) - Antti Karttunen, Jul 24 2017
Position of 2s: {5, 11, 36, 62, 1068, 6625, 12358, 43566, ...},
position of 3: {2}, position of 5: {1}. All other positions pertain to 1 for A000961(n) <= 10^8. - Michael De Vlieger, Jul 25 2017

Examples

			n a(n) run in A000961
1:  5 (1 2 3 4 5)
2:  3 (7 8 9)
3:  1 (11)
4:  1 (13)
5:  2 (16 17)
6:  1 (19)
7:  1 (23)
8:  1 (25)
9:  1 (27)
10: 1 (29)
11: 2 (31 32)
12: 1 (37)
13: 1 (41)
14: 1 (43)
15: 1 (47)
16: 1 (49)
17: 1 (53)
18: 1 (59)
19: 1 (61)
20: 1 (64)
21: 1 (67)
22: 1 (71)
23: 1 (73)
24: 1 (79)
25: 1 (81)
26: 1 (83)
27: 1 (89)
28: 1 (97)
29: 1 (101)
30: 1 (103)
31: 1 (107)
32: 1 (109)
33: 1 (113)
34: 1 (121)
35: 1 (125)
36: 2 (127 128)
37: 1 (131)
38: 1 (137)
etc.
		

Crossrefs

Programs

  • Mathematica
    With[{n = 500}, Function[s, Function[t, Length /@ DeleteCases[Split@ ReplacePart[t, Map[# -> 1 &, s]], k_ /; First@ k == 0]]@ ConstantArray[0, Max@ s]]@ Sort@ Flatten[{{1}}~Join~Array[Function[p, Map[p^# &, Range@ Floor@ Log[p, n]] ][Prime@ #] &, PrimePi@ n]]] (* Michael De Vlieger, Jul 25 2017 *)

Extensions

Terms a(33) & a(36) corrected, more terms added by Antti Karttunen, Jul 24 2017

A375706 First differences of non-perfect-powers.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Aug 31 2024

Keywords

Comments

Non-perfect-powers (A007916) are numbers without a proper integer root.

Examples

			The 5th non-perfect-power is 7, and the 6th is 10, so a(5) = 3.
		

Crossrefs

For prime-powers (A000961) we have A057820.
For perfect powers (A001597) we have A053289.
For nonprime numbers (A002808) we have A073783.
For squarefree numbers (A005117) we have A076259.
First differences of A007916.
For nonsquarefree numbers (A013929) we have A078147.
For non-prime-powers (A024619) we have A375708.
Positions of 1s are A375740, complement A375714.
Runs of non-perfect-powers:
- length: A375702 = A053289(n+1) - 1
- first: A375703 (same as A216765 with 2 exceptions)
- last: A375704 (same as A045542 with 8 removed)
- sum: A375705

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Differences[Select[Range[100],radQ]]
  • PARI
    up_to = 112;
    A375706list(up_to) = { my(v=vector(up_to), pk=2, k=2, i=0); while(i<#v, k++; if(!ispower(k), i++; v[i] = k-pk; pk = k)); (v); };
    v375706 = A375706list(up_to);
    A375706(n) = v375706[n]; \\ Antti Karttunen, Jan 19 2025
  • Python
    from itertools import count
    from sympy import mobius, integer_nthroot, perfect_power
    def A375706(n):
        def f(x): return int(n+1-sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, 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 not perfect_power(i))-m # Chai Wah Wu, Sep 09 2024
    

Formula

a(n) = A007916(n+1) - A007916(n).

Extensions

More terms from Antti Karttunen, Jan 19 2025

A345531 Smallest prime power greater than the n-th prime.

Original entry on oeis.org

3, 4, 7, 8, 13, 16, 19, 23, 25, 31, 32, 41, 43, 47, 49, 59, 61, 64, 71, 73, 79, 81, 89, 97, 101, 103, 107, 109, 113, 121, 128, 137, 139, 149, 151, 157, 163, 167, 169, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 243, 256, 263, 269, 271, 277
Offset: 1

Views

Author

Dario T. de Castro, Jun 20 2021

Keywords

Comments

Take the family of correlated prime-indexed conjectures appearing in A343249 - A343253, in which an alternative formula for the p-adic order of positive integers is proposed. There, the general p-indexed conjecture says that v_p(n), the p-adic order of n, is given by the formula: v_p(n) = log_p(n / L_p(k0, n)), where L_p(k0, n) is the lowest common denominator of the elements of the set S_p(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by p}. Evidence suggests that the primality of p is a necessary condition in this general conjecture. So, if a composite number q is used instead of a prime p in the proposed formula for the p-adic (now, q-adic) order of n, the first counterexample (failure) is expected to occur for n = q * a(i), where i is the index of the smallest prime that divides q.
The prime-power a(n) is at most the next prime, so this sequence is strictly increasing. See also A366833. - Gus Wiseman, Nov 06 2024

Examples

			a(4) = 8 because the fourth prime number is 7, and the least power of a prime which is greater than 7 is 2^3 = 8.
		

Crossrefs

Starting with n instead of prime(n): A000015, A031218, A377468, A377780, A377782.
Opposite (greatest prime-power less than): A065514, A377289, A377781.
For squarefree instead of prime-power: A112926, opposite A112925.
The difference from prime(n) is A377281.
The prime terms have indices A377286(n) - 1.
First differences are A377703.
A version for perfect-powers is A378249.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 and A361102 list the non-prime-powers, differences A375735.

Programs

  • Maple
    f:= proc(n) local p,x;
      p:= ithprime(n);
      for x from p+1 do
        if nops(numtheory:-factorset(x)) = 1 then return x fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 25 2024
  • Mathematica
    a[i_]:= Module[{j, k, N = 0, tab={}}, tab = Sort[Drop[DeleteDuplicates[Flatten[Table[ If[Prime[j]^k > Prime[i], Prime[j]^k], {j, 1, i+1}, {k, 1, Floor[Log[Prime[j], Prime[i+1]]]}]]], 1]]; N = Take[tab, 1][[1]]; N];
    tabseq = Table[a[i],{i, 1, 100}];
    (* second program *)
    Table[NestWhile[#+1&,Prime[n]+1, Not@*PrimePowerQ],{n,100}] (* Gus Wiseman, Nov 06 2024 *)
  • PARI
    A000015(n) = for(k=n,oo,if((1==k)||isprimepower(k),return(k)));
    A345531(n) = A000015(1+prime(n)); \\ Antti Karttunen, Jul 19 2021
    
  • Python
    from itertools import count
    from sympy import prime, factorint
    def A345531(n): return next(filter(lambda m:len(factorint(m))<=1, count(prime(n)+1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(1+A000040(n)). - Antti Karttunen, Jul 19 2021
a(n) = A000015(A008864(n)). - Omar E. Pol, Oct 27 2021

A065514 Largest power of a prime < prime(n).

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 19, 27, 29, 32, 37, 41, 43, 49, 53, 59, 64, 67, 71, 73, 81, 83, 89, 97, 101, 103, 107, 109, 125, 128, 131, 137, 139, 149, 151, 157, 163, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 243, 256, 257, 263, 269, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Starting with n instead of prime(n) gives A031218 (A377282, A377782).
The squarefree version is A112925 (A070321, A378038).
The opposite squarefree version is A112926 (A378037, restriction of A067535).
Difference from prime(n) is A377289 (restriction of A276781, opposite A377281).
First differences are A377781.
The nonsquarefree version is A378032 (A377783 (restriction of A378033), A378034, A378040).
The perfect power version is A378035.
A000015 gives the least prime power >= n, differences A377780.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A345531 gives the least prime power > prime(n), differences A377703.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057, A377286.

Programs

  • Mathematica
    lpp[n_]:=Module[{k=n-1},While[!PrimePowerQ[k],k--];k]; Join[{1},Table[ lpp[ n],{n,Prime[Range[2,60]]}]] (* Harvey P. Dale, Nov 24 2018 *)
  • Python
    from sympy import factorint, prime
    def A065514(n): return next(filter(lambda m:len(factorint(m))<=1, range(prime(n)-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Extensions

Name edited (1 is technically not a prime power even though it is a power of a prime) by Gus Wiseman, Dec 03 2024.

A080101 Number of prime powers in all composite numbers between n-th prime and next prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

The maximum value of terms in the sequence, through the (10^5)th term, is 2. - Harvey P. Dale, Aug 24 2014
This is conjectured to be the maximum, see also A366833. - Gus Wiseman, Nov 06 2024

Examples

			There are two prime powers between 2179 = A000040(327) and 2203 = A000040(328): 2187 = 3^7 and 2197 = 13^3, therefore a(327) = 2, A080102(327) = 2187 and A080103(327) = 2197.
		

Crossrefs

For powers of 2 instead of primes we have A244508, see also A013597, A014210, A014234, A304521.
Adding one gives A366833.
For non-prime-powers instead of prime-powers we have A368748.
Positions of positive terms are A377057, primes A053607.
Positions of 0 are A377286.
Positions of 1 are A377287.
Positions of 2 are A377288, primes A053706.
For perfect-powers (instead of prime-powers) we have A377432.
A000015 gives the least prime-power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, seconds A376596.
A031218 gives the greatest prime-power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A246655 lists the prime-powers not including 1, complement A361102.
A345531 gives the least prime-power > prime(n), difference A377281.

Programs

  • Maple
    a := proc(n) local c, k, p: c, p := 0, ithprime(n): for k from p+1 to nextprime(p)-1 do if nops(numtheory:-factorset(k)) = 1 then c := c+1: fi: od: c: end:
    seq(a(n), n = 1 .. 105); # Lorenzo Sauras Altuzarra, Jul 08 2022
  • Mathematica
    prpwQ[n_]:=Module[{fi=FactorInteger[n]},Length[fi]==1&&fi[[1,2]]>1]; nn=600;With[{pwrs=Table[If[prpwQ[n],1,0],{n,nn}]},Table[Total[ Take[ pwrs,{Prime[n],Prime[n+1]}]],{n,PrimePi[nn]-1}]] (* Harvey P. Dale, Aug 24 2014 *)
    Table[Length[Select[Range[Prime[n]+1,Prime[n+1]-1],PrimePowerQ]],{n,30}] (* Gus Wiseman, Nov 06 2024 *)

Formula

a(n) = A366833(n) - 1. - Gus Wiseman, Nov 06 2024
Showing 1-10 of 137 results. Next