A378363
Greatest number <= n that is 1 or not a perfect-power.
Original entry on oeis.org
1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 12, 13, 14, 15, 15, 17, 18, 19, 20, 21, 22, 23, 24, 24, 26, 26, 28, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67
Offset: 1
In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
A069623 counts perfect-powers <= n.
A131605 lists perfect-powers that are not prime-powers.
-
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
Table[NestWhile[#-1&,n,#>1&&perpowQ[#]&],{n,100}]
-
from sympy import mobius, integer_nthroot
def A378363(n):
def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
a = n-f(n)
m, k = a, f(a)+a
while m != k: m, k = k, f(k)+a
return m # Chai Wah Wu, Nov 26 2024
A378367
Greatest non prime power <= n, allowing 1.
Original entry on oeis.org
1, 1, 1, 1, 1, 6, 6, 6, 6, 10, 10, 12, 12, 14, 15, 15, 15, 18, 18, 20, 21, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 30, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 48, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 63, 65, 66, 66
Offset: 1
The greatest non prime power <= 7 is 6, so a(7) = 6.
Sequences obtained by subtracting each term from n are placed in parentheses below.
For non perfect power we have
A378363.
Subtracting from n gives (
A378366).
-
Table[NestWhile[#-1&,n,PrimePowerQ[#]&],{n,100}]
A379157
Prime powers p such that the interval from p to the next prime power contains a unique prime number.
Original entry on oeis.org
3, 4, 7, 9, 13, 16, 23, 27, 31, 32, 47, 49, 61, 64, 79, 81, 113, 125, 127, 128, 167, 169, 241, 243, 251, 256, 283, 289, 337, 343, 359, 361, 509, 512, 523, 529, 619, 625, 727, 729, 839, 841, 953, 961, 1021, 1024, 1327, 1331, 1367, 1369, 1669, 1681, 1847, 1849
Offset: 1
The next prime power after 32 is 37, with interval (32,33,34,35,36,37) containing just one prime 37, so 32 is in the sequence.
The previous instead of next prime power we have
A175106.
For perfect powers instead of prime powers we have
A378355.
A000015 gives the least prime power >= n.
A031218 gives the greatest prime power <= n.
A065514 gives the greatest prime power < prime(n), difference
A377289.
A366835 counts primes between prime powers, for perfect powers
A080769.
-
v=Select[Range[100],PrimePowerQ]
nextpripow[n_]:=NestWhile[#+1&,n+1,!PrimePowerQ[#]&]
Select[v,Length[Select[Range[#,nextpripow[#]],PrimeQ]]==1&]
A002540
Increasing gaps between prime-powers.
Original entry on oeis.org
1, 5, 13, 19, 32, 53, 89, 139, 199, 293, 887, 1129, 1331, 5591, 8467, 9551, 15683, 19609, 31397, 155921, 360653, 370261, 492113, 1349533, 1357201, 2010733, 4652353, 17051707, 20831323, 47326693, 122164747, 189695659, 191912783, 387096133, 436273009, 1294268491
Offset: 1
- J. P. Gram, Undersoegelser angaaende maengden af primtal under en given graense, Det Kongelige Danskevidenskabernes Selskabs Skrifter, series 6, vol. 2 (1884), 183-288; see p. 255.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Jan Kristian Haugland, Table of n, a(n) for n = 1..87 (terms 1..79 from Donovan Johnson). The extra terms are copied from A002386 as the associated prime gaps do not contain any prime powers.
- J. P. Gram, Undersoegelser angaaende maengden af primtal under en given graense (1884) [Scanned copy of page 255 with annotations by Victor Meally and N. J. A. Sloane]
- Des MacHale and Joseph Manning, Maximal runs of strictly composite integers, The Mathematical Gazette, Vol. 99, No. 545 (2015), pp. 213-219.
- Victor Meally, Letter to N. J. A. Sloane, Mar 17, 1980.
- Index entries for primes, gaps between.
-
s = {}; gap = 0; p1 = 1; Do[If[PrimePowerQ[p2], If[(d = p2 - p1) > gap, gap = d; AppendTo[s, p1]]; p1 = p2], {p2, 2, 10^6}]; s (* Amiram Eldar, Dec 12 2022 *)
Join[{1},Rest[Module[{nn=5*10^6,pps},pps=Select[Range[nn],PrimePowerQ]; DeleteDuplicates[ Thread[{Most[ pps],Differences[ pps]}],GreaterEqual[ #1[[2]],#2[[2]]]&]][[;;,1]]]] (* The program generates the first 27 terms of the sequence. *) (* Harvey P. Dale, Aug 20 2024 *)
-
/* calculates smaller terms - see Donovan Johnson link for larger terms */
isA000961(n) = (omega(n) == 1 || n == 1)
d_max=0;n_prev=1;for(n=2,1e6,if(isA000961(n),d=n-n_prev;if(d>d_max,print(n_prev);d_max=d);n_prev=n)) \\ Michael B. Porter, Oct 31 2009
A376268
Sorted positions of first appearances in the first differences (A053289) of perfect-powers (A001597).
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 23, 24, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, 81
Offset: 1
The perfect powers (A001597) are:
1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, ...
with first differences (A053289):
3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, ...
with positions of first appearances (A376268):
1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 16, 17, 18, 19, 21, 23, 24, 27, 28, 29, ...
These are the sorted positions of first appearances in
A053289 (union
A023055).
A053707 lists first differences of consecutive prime-powers.
A333254 lists run-lengths of differences between consecutive primes.
Other families of numbers and their first differences:
Cf.
A025475,
A045542,
A052410,
A069623,
A093555,
A174965,
A216765,
A303707,
A305630,
A305631,
A375736.
-
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
q=Differences[Select[Range[1000],perpowQ]];
Select[Range[Length[q]],!MemberQ[Take[q,#-1],q[[#]]]&]
A376519
Positions of terms not appearing for the first time in the first differences (A053289) of perfect-powers (A001597).
Original entry on oeis.org
8, 14, 15, 20, 22, 25, 26, 31, 40, 46, 52, 59, 68, 75, 88, 96, 102, 110, 111, 112, 114, 128, 136, 144, 145, 162, 180, 188, 198, 216, 226, 235, 246, 264, 265, 275, 285, 295, 305, 316, 317, 325, 328, 338, 350, 360, 367, 373, 385, 406, 416, 417, 419, 431, 443
Offset: 1
The perfect powers (A001597) are:
1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, ...
with first differences (A053289):
3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, ...
with positions of latter appearances (A376519):
8, 14, 15, 20, 22, 25, 26, 31, 40, 46, 52, 59, 68, 75, 88, 96, 102, 110, 111, ...
These are the sorted positions of latter appearances in
A053289 (union
A023055).
A053707 lists first differences of consecutive prime-powers.
A333254 lists run-lengths of differences between consecutive primes.
Other families of numbers and their first differences:
Cf.
A025475,
A045542,
A046933,
A052410,
A069623,
A174965,
A216765,
A303707,
A305630,
A305631,
A375736.
-
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
q=Differences[Select[Range[1000],perpowQ]];
Select[Range[Length[q]],MemberQ[Take[q,#-1],q[[#]]]&]
A378457
Difference between n and the greatest prime power <= n, allowing 1.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 0, 1, 2, 3, 4
Offset: 1
The greatest prime power <= 6 is 5, so a(6) = 1.
Sequences obtained by subtracting each term from n are placed in parentheses below.
Subtracting from n gives (
A031218).
For nonsquarefree we have (
A378033).
For non perfect power we have (
A378363).
A000015 gives the least prime power >= n.
Cf.
A001597,
A007920,
A013632,
A065514,
A074984,
A377051,
A377054,
A377281,
A377289,
A377468,
A378357,
A378371.
-
Table[n-NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]
A379156
Positions in A246655 (prime powers) of terms q such that there is no prime between q and the next prime power.
Original entry on oeis.org
6, 14, 41, 359, 3589
Offset: 1
For perfect powers instead of prime powers we have
A274605.
A000015 gives the least prime power >= n.
A031218 gives the greatest prime power <= n.
A065514 gives the greatest prime power < prime(n), difference
A377289.
A131605 finds perfect powers that are not prime powers.
Cf.
A025474,
A046933,
A067871,
A080101,
A080769,
A175106,
A178700,
A345531,
A377281,
A377287,
A377432,
A377434.
-
v=Select[Range[100],PrimePowerQ];
Select[Range[Length[v]-1],FreeQ[Range[v[[#]],v[[#+1]]],_?PrimeQ]&]
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 20, 22, 30, 32, 34, 36, 44, 52, 72, 86, 96, 112, 114, 118, 132, 148, 154, 180, 210, 220, 222, 234, 248, 250, 282, 288, 292, 320, 336, 354, 382, 384, 394, 456, 464, 468, 474, 486, 490, 500, 514, 516, 532, 534, 540, 582, 588, 602
Offset: 1
6 is in the sequence since 53 and 59 are consecutive prime powers and no smaller pair of consecutive prime powers differ by 6 or more. [From _Michael B. Porter_, Nov 03 2009]
- Jan Kristian Haugland, Table of n, a(n) for n = 1..87 (terms 1..79 from _Donovan Johnson_). The extra terms are copied from A005250 as the associated prime gaps do not contain any prime powers.
-
isA000961(n) = (omega(n) == 1 || n == 1)
d_max=0;n_prev=1;for(n=2,1e6,if(isA000961(n),d=n-n_prev;if(d>d_max,print(d); d_max=d);n_prev=n)) /* Michael B. Porter, Nov 01 2009 */
Second term corrected. a(20)-a(79) and b-file from
Donovan Johnson, Nov 14 2008
A376264
Run-sums of first differences (A078147) of nonsquarefree numbers (A013929).
Original entry on oeis.org
4, 1, 3, 4, 4, 4, 1, 2, 1, 16, 1, 3, 2, 6, 4, 3, 1, 8, 3, 1, 4, 1, 3, 4, 4, 4, 2, 2, 16, 1, 3, 1, 3, 2, 2, 4, 3, 1, 8, 3, 1, 4, 1, 3, 4, 4, 4, 1, 2, 1, 3, 1, 12, 1, 3, 4, 4, 4, 3, 1, 16, 1, 3, 4, 4, 4, 2, 3, 3, 4, 8, 1, 3, 4, 4, 3, 1, 3, 1, 8, 1, 3, 4, 1, 3, 4
Offset: 1
The sequence of nonsquarefree numbers (A013929) is:
4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, ...
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, ...
with runs:
(4),(1),(3),(4),(2,2),(4),(1),(2),(1),(4,4,4,4),(1),(3),(1,1),(2,2,2), ...
with sums (A376264):
4, 1, 3, 4, 4, 4, 1, 2, 1, 16, 1, 3, 2, 6, 4, 3, 1, 8, 3, 1, 4, 1, 3, 4, ...
Before taking run-sums we had
A078147.
For nonprime instead of nonsquarefree numbers we have
A373822.
For run-lengths instead of run-sums we have
A376267.
For squarefree instead of nonsquarefree we have
A376307.
For prime-powers instead of nonsquarefree numbers we have
A376310.
For compression instead of run-sums we have
A376312.
Cf.
A053797,
A053806,
A061398,
A072284,
A120992,
A373197,
A373413,
A375707,
A376305,
A376306,
A376311.
Comments