2, 2, 3, 4, 4, 3, 4, 3, 4, 2, 1, 2, 3, 2, 3, 4, 6, 3, 2, 3, 4, 5, 4, 5, 6, 2, 3, 10, 3, 4, 3, 4, 3, 6, 9, 6, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4, 2, 5, 4, 5, 2, 3, 4, 7, 6, 5, 4, 5, 10, 5, 6, 6, 3, 2, 5, 4, 3, 4, 5, 4, 7, 6, 3, 4, 5, 6, 7, 6, 2, 1, 2, 3, 4, 1, 2, 3, 2, 3, 4, 5, 2, 3, 4, 3, 4, 5, 6, 6, 5, 4
Offset: 3
A058188
Number of primes between prime(n) and prime(n) + sqrt(prime(n)), where prime(n) is the n-th prime.
Original entry on oeis.org
1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 3, 3, 2, 1, 0, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 1, 3, 4, 3, 2, 2, 1, 2, 3, 3, 4, 3, 3, 2, 1, 1, 3, 2, 1, 1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 2, 3, 2, 4, 3, 4, 3, 3, 4, 4, 3, 3, 2, 2, 3, 4, 3, 3, 3, 2, 2, 1, 3
Offset: 1
a(12) = 2 because between p(12)= 37 and 37+sqrt(37) = 43.08 there are two primes: 41 and 43
- R. K. Guy: Unsolved problems in number theory, 2nd ed., Springer-Verlag,1994; Sections A8, A 9.
- Paulo Ribenboim: The little book of big primes, Springer-Verlag,1991; 142ff
-
Table[PrimePi[p+Sqrt[p]]-PrimePi[p],{p,Prime[Range[100]]}] (* Harvey P. Dale, Mar 13 2023 *)
-
a(n) = my(p=prime(n)); primepi(p+sqrtint(p)) - n; \\ Michel Marcus, Jun 21 2017
A076044
Largest a(n) values with at most n primes between a(n) and a(n)+sqrt(a(n)) inclusive.
Original entry on oeis.org
116, 1330, 2481, 2558, 5929, 7371, 9961, 10743, 23378, 35608, 35612, 38361, 44286, 46902, 69503, 69545, 88024, 107359, 110087, 110099, 113386, 126860, 250172, 250180, 250186, 250202, 267969, 267975, 285846, 285858, 302013, 302017, 360346, 369213, 404562, 404574, 484650, 484654, 514893, 561443, 561481, 561509, 561533, 638194, 638208, 650020, 682490, 713634, 713636
Offset: 0
a(3)=2558 because there are three primes between 2558 and int(2558+sqrt 2558)= 2608 and for every larger number there are more than 3 primes in the respective interval.
- P. Ribenboim, The Little Book of Big Primes, Springer-Verlag, 1991, p. 143
A056240
Smallest number whose prime divisors (taken with multiplicity) add to n.
Original entry on oeis.org
2, 3, 4, 5, 8, 7, 15, 14, 21, 11, 35, 13, 33, 26, 39, 17, 65, 19, 51, 38, 57, 23, 95, 46, 69, 92, 115, 29, 161, 31, 87, 62, 93, 124, 155, 37, 217, 74, 111, 41, 185, 43, 123, 86, 129, 47, 215, 94, 141, 188, 235, 53, 329, 106, 159, 212, 265, 59, 371, 61, 177, 122
Offset: 2
a(8) = 15 = 3*5 because 15 is the smallest number whose prime divisors sum to 8.
a(10000) = 586519: Let pp(n) be the largest prime < n and the candidate being the current value that might be a(10000). Then we see that pp(10000 - 1) = 9973, giving a candidate 9973 * a(10000 - 9973) = 9973 * 92. pp(9973) = 9967, giving a candidate 9967 * a(10000 - 9967) = 9967 * 62. pp(9967) = 9949, giving the candidate 9949 * a(10000 - 9949) = 9962 * 188. This is larger than our candidate so we keep 9967 * 62 as our candidate. pp(9949) = 9941, giving a candidate 9941 * pp(10000 - 9941) = 9941 * 59. We see that (n - p) * a(p) >= (n - p) * p > candidate = 9941 * 59 for p > 59 so we stop iterating to conclude a(10000) = 9941 * 59 = 586519. - _David A. Corneth_, Mar 23 2018, edited by _M. F. Hasler_, Jan 19 2019
First column of array
A064364, n>=2.
See
A000792 for the maximal numbers whose prime factors sums up to n.
-
a056240 = (+ 1) . fromJust . (`elemIndex` a001414_list)
-- Reinhard Zumkeller, Jun 14 2012
-
A056240 := proc(n)
local k ;
for k from 1 do
if A001414(k) = n then
return k ;
end if;
end do:
end proc:
seq(A056240(n),n=2..80) ; # R. J. Mathar, Apr 15 2024
-
a = Table[0, {75}]; Do[b = Plus @@ Flatten[ Table[ #1, {#2}] & @@@ FactorInteger[n]]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 2, 1000}]; a (* Robert G. Wilson v, May 04 2002 *)
b[n_] := b[n] = Total[Times @@@ FactorInteger[n]];
a[n_] := For[k = 2, True, k++, If[b[k] == n, Return[k]]];
Table[a[n], {n, 2, 63}] (* Jean-François Alcover, Jul 03 2017 *)
-
isok(k, n) = my(f=factor(k)); sum(j=1, #f~, f[j,1]*f[j,2]) == n;
a(n) = my(k=2); while(!isok(k, n), k++); k; \\ Michel Marcus, Jun 21 2017
-
a(n) = {if(n < 7, return(n + 2*(n==6))); my(p = precprime(n), res); if(p == n, return(p), p = precprime(n - 2); res = p * a(n - p); while(res > (n - p) * p && p > 2, p = precprime(p - 1); res = min(res, a(n - p) * p)); res)} \\ David A. Corneth, Mar 23 2018
-
A056240(n, p=n-1, m=oo)=if(n<6 || isprime(n), n, n==6, 8, until(p<3 || (n-p=precprime(p-1))*p >= m=min(m,A056240(n-p)*p),); m) \\ M. F. Hasler, Jan 19 2019
A048298
a(n) = n if n=2^i for i >= 0, otherwise a(n) = 0.
Original entry on oeis.org
0, 1, 2, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Jean-Paul Allouche and Jeffrey Shallit, The Ring of k-regular Sequences, II.
- Jean-Paul Allouche and Jeffrey Shallit, The ring of k-regular sequences, II, Theoret. Computer Sci., 307 (2003), 3-29.
- Daniele A. Gewurz and Francesca Merola, Sequences realized as Parker vectors of oligomorphic permutation groups, J. Integer Seqs., Vol. 6, 2003.
This is Guy Steele's sequence GS(5, 1) (see
A135416).
Cf.
A209229 (characteristic function of powers of 2).
-
a048298 n = a209229 n * n -- Reinhard Zumkeller, Oct 17 2015
-
[n eq 2^Valuation(n,2) select n else 0: n in [0..120]]; // Vincenzo Librandi, improved by Bruno Berselli, Mar 27 2015
-
0, seq(op([2^n,0$(2^n-1)]), n=0..10); # Robert Israel, Mar 25 2015
a := n -> if n = 2^ilog2(n) then n else 0 fi: # Peter Luschny, Oct 03 2022
-
Table[n*Boole[Or[n == 1, First /@ FactorInteger@ n == {2}]], {n, 0, 120}] (* Michael De Vlieger, Mar 25 2015 *)
a[n_] := If[n == 2^IntegerExponent[n, 2], n, 0]; Array[a, 100, 0] (* Amiram Eldar, Oct 10 2023 *)
-
a(n)=direuler(p=1,n,if(p==2,1/(1-2*X),1))[n] /* Ralf Stephan, Mar 27 2015 */
-
a(n) = if(n == 0, 0, if(n == 1 << valuation(n, 2), n, 0)); \\ Amiram Eldar, Oct 10 2023
-
def A048298(n): return n if n and not(n&-n)^n else 0 # Chai Wah Wu, Dec 01 2022
More terms from Keiko L. Noble (s1180624(AT)cedarville.edu)
Comments