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

A256447 Number of integers in range (prime(n)^2)+1 .. (prime(n)*prime(n+1)) whose smallest prime factor is at least prime(n): a(n) = A250477(n) - A250474(n).

Original entry on oeis.org

2, 3, 3, 7, 5, 9, 6, 13, 23, 9, 28, 22, 12, 24, 39, 37, 17, 44, 32, 16, 53, 37, 53, 76, 46, 23, 43, 20, 49, 161, 48, 82, 23, 142, 27, 91, 90, 66, 103, 97, 41, 181, 41, 74, 39, 228, 228, 86, 45, 86, 130, 44, 217, 134, 141, 138, 46, 148, 106, 47, 261, 355, 116, 53, 109, 387, 166, 284, 65, 119, 181, 243, 198, 195, 122, 190, 268, 125, 265, 330, 78
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

a(n) = number of integers in range [(prime(n)^2)+1, (prime(n) * prime(n+1))] whose smallest prime factor is at least prime(n).
All the terms are strictly positive, because at least for the last number in the range we have A020639(prime(n)*prime(n+1)) = prime(n).
See the conjectures in A256448.

Examples

			For n=1, we have in range [(prime(1)^2)+1, (prime(1) * prime(2))], that is, in range [5,6], two numbers, 5 and 6, whose smallest prime factor (A020639) is at least 2, thus a(1) = 2.
For n=2, we have in range [10, 15] three numbers, {11, 13, 15}, whose smallest prime factor is at least 3, thus a(2) = 3.
For n=3, we have in range [26, 35] three numbers, {29, 31, 35}, whose smallest prime factor is at least prime(3) = 5, thus a(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Count[Range[Prime[n]^2 + 1, Prime[n] Prime[n + 1]],
      x_ /; Min[First /@ FactorInteger[x]] >=
    Prime@n]; Array[f, 81] (* Michael De Vlieger, Mar 30 2015 *)
  • Scheme
    (define (A256447 n) (- (A250477 n) (A250474 n)))

Formula

a(n) = A250477(n) - A250474(n).
a(n) = A251723(n) - A256448(n).
a(n) = A256448(n) + A256449(n).
a(n) = A256468(n) + 1.
Other identities. For all n >= 1:
a(n+1) = A256446(n) - A256448(n).

A256448 a(n) = A250474(n+1) - A250477(n).

Original entry on oeis.org

-1, 1, 2, 7, 3, 12, 4, 13, 23, 6, 28, 21, 7, 21, 40, 40, 14, 45, 33, 13, 52, 37, 60, 86, 42, 18, 43, 21, 50, 192, 50, 82, 25, 156, 30, 90, 95, 61, 94, 97, 34, 174, 35, 69, 35, 234, 250, 81, 36, 79, 139, 45, 220, 140, 132, 153, 44, 143, 92, 51, 250, 379, 103, 53, 105, 396, 174, 294, 59, 121, 181, 245, 182, 184, 129, 203, 261, 136, 265, 339, 72
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

a(n) tells how many more positive integers there are <= prime(n+1)^2 whose smallest prime factor is at least prime(n+1), as compared to how many positive integers there are <= (prime(n) * prime(n+1)) whose smallest prime factor is at least prime(n).
Conjecture 1: for n >= 2, a(n) > 0.
Conjecture 2: ratio a(n)/A256447 converges towards 1. See the associated plots in A256447 and A256449 and comments in A050216.
As what comes to the second conjecture, it's not necessarily true. See the plots linked into A256468. - Antti Karttunen, Mar 30 2015

Examples

			For n=1, the respective primes are prime(1) = 2 and prime(2) = 3, and the ranges in question are [1, 9] and [1, 6]. The former range contains 4 such numbers whose lpf (A020639) is at least 3, namely {3, 5, 7, 9}, while the latter range contains 5 such numbers whose lpf is at least 2, namely {2, 3, 4, 5, 6}, thus a(1) = 4 - 5 = -1.
For n=2, the respective primes are prime(2) = 3 and prime(3) = 5, and the ranges in question are [1, 25] and [1, 15]. The former range contains 8 such numbers whose lpf is at least 5, namely {5, 7, 11, 13, 17, 19, 23, 25}, while the latter range contains 7 such numbers whose lpf is at least 3, namely {3, 5, 7, 9, 11, 13, 15}, thus a(2) = 8 - 7 = 1.
For n=3, the respective primes are prime(3) = 5 and prime(4) = 7, and the ranges in question are [1, 49] and [1, 35]. The former range contains 13 such numbers whose lpf is at least 7, namely {7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49}, while the latter range contains 11 such numbers whose lpf is at least 5, namely {5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35}, thus a(3) = 13 - 11 = 2.
		

Crossrefs

Programs

Formula

a(n) = A256469(n) - 2.
a(n) = A250474(n+1) - A250477(n).
a(n) = A251723(n) - A256447(n).
a(n) = A256446(n) - A256447(n+1).
a(n) = A256447(n) - A256449(n).

A256446 First differences of A250477: a(n) = A250477(n+1) - A250477(n).

Original entry on oeis.org

2, 4, 9, 12, 12, 18, 17, 36, 32, 34, 50, 33, 31, 60, 77, 57, 58, 77, 49, 66, 89, 90, 136, 132, 65, 61, 63, 70, 211, 240, 132, 105, 167, 183, 121, 180, 161, 164, 191, 138, 215, 215, 109, 108, 263, 462, 336, 126, 122, 209, 183, 262, 354, 281, 270, 199, 192, 249, 139, 312, 605, 495, 156, 162, 492, 562, 458, 359, 178, 302, 424, 443, 377, 306
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A250477(n+1) - A250477(n).
a(n) = A256447(n+1) + A256448(n).

A078898 Number of times the smallest prime factor of n is the smallest prime factor for numbers <= n; a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 4, 11, 1, 12, 2, 13, 5, 14, 1, 15, 1, 16, 6, 17, 3, 18, 1, 19, 7, 20, 1, 21, 1, 22, 8, 23, 1, 24, 2, 25, 9, 26, 1, 27, 4, 28, 10, 29, 1, 30, 1, 31, 11, 32, 5, 33, 1, 34, 12, 35, 1, 36, 1, 37, 13, 38, 3, 39, 1, 40, 14, 41, 1, 42, 6, 43
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 12 2002

Keywords

Comments

From Antti Karttunen, Dec 06 2014: (Start)
For n >= 2, a(n) tells in which column of the sieve of Eratosthenes (see A083140, A083221) n occurs in. A055396 gives the corresponding row index.
(End)

Crossrefs

Programs

  • Haskell
    import Data.IntMap (empty, findWithDefault, insert)
    a078898 n = a078898_list !! n
    a078898_list = 0 : 1 : f empty 2 where
       f m x = y : f (insert p y m) (x + 1) where
               y = findWithDefault 0 p m + 1
               p = a020639 x
    -- Reinhard Zumkeller, Apr 06 2015
  • Maple
    N:= 1000: # to get a(0) to a(N)
    Primes:= select(isprime, [2,seq(2*i+1,i=1..floor((N-1)/2))]):
    A:= Vector(N):
    for p in Primes do
      t:= 1:
      A[p]:= 1:
      for n from p^2 to N by p do
        if A[n] = 0 then
           t:= t+1:
           A[n]:= t
        fi
      od
    od:
    0,1,seq(A[i],i=2..N); # Robert Israel, Jan 04 2015
  • Mathematica
    Module[{nn=90,spfs},spfs=Table[FactorInteger[n][[1,1]],{n,nn}];Table[ Count[ Take[spfs,i],spfs[[i]]],{i,nn}]] (* Harvey P. Dale, Sep 01 2014 *)
  • PARI
    \\ Not practical for computing, but demonstrates the sum moebius formula:
    A020639(n) = { if(1==n,n,vecmin(factor(n)[, 1])); };
    A055396(n) = { if(1==n,0,primepi(A020639(n))); };
    A002110(n) = prod(i=1, n, prime(i));
    A078898(n) = { my(k,p); if(1==n, n, k = A002110(A055396(n)-1); p = A020639(n); sumdiv(k, d, moebius(d)*(n\(p*d)))); };
    \\ Antti Karttunen, Dec 05 2014
    
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A078898 n) (if (< n 2) n (+ 1 (A078898 (A249744 n)))))
    ;; Much better for computing. Needs also code from A249738 and A249744. - Antti Karttunen, Dec 06 2014
    

Formula

Ordinal transform of A020639 (Lpf). - Franklin T. Adams-Watters, Aug 28 2006
From Antti Karttunen, Dec 05-08 2014: (Start)
a(0) = 0, a(1) = 1, a(n) = 1 + a(A249744(n)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(n / (A020639(n)*d)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(A032742(n) / d).
[Instead of Moebius mu (A008683) one could use Liouville's lambda (A008836) in the above formulas, because all primorials (A002110) are squarefree. A020639(n) gives the smallest prime dividing n, and A055396 gives its index].
a(0) = 0, a(1) = 1, a(2n) = n, a(2n+1) = a(A250470(2n+1)). [After a similar recursive formula for A246277. However, this cannot be used for computing the sequence, unless a definition for A250470(n) is found which doesn't require computing the value of A078898(n).]
For n > 1: a(n) = A249810(n) - A249820(n).
(End)
Other identities:
a(2*n) = n.
For n > 1: a(n)=1 if and only if n is prime.
For n > 1: a(n) = A249808(n, A055396(n)) = A249809(n, A055396(n)).
For n > 1: a(n) = A246277(A249818(n)).
From Antti Karttunen, Jan 04 2015: (Start)
a(n) = 2 if and only if n is a square of a prime.
For all n >= 1: a(A251728(n)) = A243055(A251728(n)) + 2. That is, if n is a semiprime of the form prime(i)*prime(j), prime(i) <= prime(j) < prime(i)^2, then a(n) = (j-i)+2.
(End)
a(A000040(n)^2) = 2; a(A000040(n)*A000040(n+1)) = 3. - Reinhard Zumkeller, Apr 06 2015
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{k>=1} (A038110(k)/A038111(k))^2 = 0.2847976823663... . - Amiram Eldar, Oct 26 2024

Extensions

a(0) = 0 prepended for recurrence's sake by Antti Karttunen, Dec 06 2014

A250474 Number of times prime(n) occurs as the least prime factor among numbers 1 .. prime(n)^3: a(n) = A078898(A030078(n)).

Original entry on oeis.org

4, 5, 9, 14, 28, 36, 57, 67, 93, 139, 154, 210, 253, 272, 317, 396, 473, 504, 593, 658, 687, 792, 866, 979, 1141, 1229, 1270, 1356, 1397, 1496, 1849, 1947, 2111, 2159, 2457, 2514, 2695, 2880, 3007, 3204, 3398, 3473, 3828, 3904, 4047, 4121, 4583, 5061, 5228, 5309, 5474, 5743, 5832, 6269, 6543, 6816, 7107, 7197, 7488, 7686, 7784, 8295, 9029, 9248, 9354, 9568, 10351
Offset: 1

Views

Author

Antti Karttunen, Nov 23 2014

Keywords

Comments

Position of the first composite number (which is always 4) on row n of A249821. The fourth column of A249822.
Position of the first nonfixed term on row n of arrays of permutations A251721 and A251722.
According to the definition, this is the number of multiples of prime(n) below prime(n)^3 (and thus, the number of numbers below prime(n)^2) which do not have a smaller factor than prime(n). That is, the numbers remaining below prime(n)^2 after deleting all multiples of primes less than prime(n), as is done by applying the first n-1 steps of the sieve of Eratosthenes (when the first step is elimination of multiples of 2). This explains that the first differences are a(n+1)-a(n) = A050216(n)-1 for n>1, and a(n) = A054272(n)+2. - M. F. Hasler, Dec 31 2014

Examples

			prime(1) = 2 occurs as the least prime factor in range [1,8] for four times (all even numbers <= 8), thus a(1) = 4.
prime(2) = 3 occurs as the least prime factor in range [1,27] for five times (when n is: 3, 9, 15, 21, 27), thus a(2) = 5.
		

Crossrefs

One more than A250473. Two more than A054272.
Column 4 of A249822.
Cf. also A250477 (column 6), A250478 (column 8).

Programs

  • Mathematica
    f[n_] := Count[Range[Prime[n]^3], x_ /; Min[First /@ FactorInteger[x]] == Prime@ n]; Array[f, 16] (* Michael De Vlieger, Mar 30 2015 *)
  • PARI
    A250474(n) = 3 + primepi(prime(n)^2) - n; \\ Fast implementation.
    for(n=1, 5001, write("b250474.txt", n, " ", A250474(n)));
    \\ The following program reflects the given sum formula, but is far from the optimal solution:
    allocatemem(234567890);
    A002110(n) = prod(i=1, n, prime(i));
    A020639(n) = if(1==n,n,vecmin(factor(n)[,1]));
    A055396(n) = if(1==n,0,primepi(A020639(n)));
    A250474(n) = { my(p2 = prime(n)^2); sumdiv(A002110(n-1), d, moebius(d)*(p2\d)); };
    for(n=1, 23, print1(A250474(n),", "));
    
  • Scheme
    (define (A250474 n) (let loop ((k 2)) (if (not (prime? (A249821bi n k))) k (loop (+ k 1))))) ;; This is even slower. Code for A249821bi given in A249821.

Formula

a(n) = 3 + A000879(n) - n = A054272(n) + 2 = A250473(n) + 1.
a(n) = A078898(A030078(n)).
a(1) = 1, a(n) = Sum_{d|A002110(n-1)} moebius(d)*floor(prime(n)^2/d). [Follows when A030078(n), prime(n)^3 is substituted to the similar formula given for A078898(n). Here A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could use also Liouville's lambda (A008836) instead of Moebius mu (A008683)].
Other identities. For all n >= 1:
A249821(n, a(n)) = 4.

A249822 Square array of permutations: A(row,col) = A078898(A246278(row,col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 5, 3, 2, 1, 6, 4, 9, 3, 2, 1, 7, 8, 4, 14, 3, 2, 1, 8, 6, 12, 4, 28, 3, 2, 1, 9, 14, 5, 21, 4, 36, 3, 2, 1, 10, 13, 42, 5, 33, 4, 57, 3, 2, 1, 11, 11, 17, 92, 5, 45, 4, 67, 3, 2, 1, 12, 7, 19, 33, 305, 5, 63, 4, 93, 3, 2, 1, 13, 23, 6, 25, 39, 455, 5, 80, 4, 139, 3, 2, 1, 14, 9, 59, 6, 43, 61, 944, 5, 116, 4, 154, 3, 2, 1, 15, 17, 7, 144, 6, 52, 70, 1238, 5, 148, 4, 210, 3, 2, 1
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Examples

			The top left corner of the array:
1, 2, 3,  4,  5,   6,   7,    8,    9,   10,  11,   12,  13,   14,   15, ...
1, 2, 3,  5,  4,   8,   6,   14,   13,   11,   7,   23,   9,   17,   18, ...
1, 2, 3,  9,  4,  12,   5,   42,   17,   19,   6,   59,   7,   22,   26, ...
1, 2, 3, 14,  4,  21,   5,   92,   33,   25,   6,  144,   7,   32,   39, ...
1, 2, 3, 28,  4,  33,   5,  305,   39,   43,   6,  360,   7,   48,   50, ...
1, 2, 3, 36,  4,  45,   5,  455,   61,   52,   6,  597,   7,   63,   68, ...
1, 2, 3, 57,  4,  63,   5,  944,   70,   76,   6, 1053,   7,   95,   84, ...
1, 2, 3, 67,  4,  80,   5, 1238,   96,   99,   6, 1502,   7,  106,  121, ...
...
		

Crossrefs

Inverse permutations can be found from table A249821.
Row k+1 is a right-to-left composition of the first k rows of A251722.
Row 1: A000027 (an identity permutation), Row 2: A048673, Row 3: A249824, Row 4: A249826.
Column 4: A250474, Column 6: A250477, Column 8: A250478.

Programs

A251720 a(n) = (p_n)^2 * p_{n+1}, where p_n is the n-th prime, A000040(n).

Original entry on oeis.org

12, 45, 175, 539, 1573, 2873, 5491, 8303, 15341, 26071, 35557, 56129, 72283, 86903, 117077, 165731, 212341, 249307, 318719, 367993, 420991, 518003, 613121, 768337, 950309, 1050703, 1135163, 1247941, 1342553, 1621663, 2112899, 2351057, 2608891, 2878829, 3352351
Offset: 1

Views

Author

Antti Karttunen, Dec 14 2014

Keywords

Comments

Subsequence of A014612: a(1)=12=A014612(2), a(2)=45=A014612(10) - Zak Seidov, Apr 26 2016

Crossrefs

Programs

  • Mathematica
    a251720[n_Integer] := Prime[#]^2*Prime[# + 1] & /@ Range[n]; a251720[35] (* Michael De Vlieger, Dec 14 2014 *)
    #[[1]]^2 #[[2]]&/@Partition[Prime[Range[40]],2,1] (* Harvey P. Dale, Mar 12 2015 *)

Formula

a(n) = A000040(n) * A000040(n) * A000040(n+1).
a(n) = A000040(n) * A006094(n).
a(n) = A001248(n) * A000040(n+1).

A250478 Number of times prime(n) occurs as the least prime factor among numbers 1 .. prime(n)^4: a(n) = A078898(A030514(n)).

Original entry on oeis.org

8, 14, 42, 92, 305, 455, 944, 1238, 2085, 3995, 4710, 7757, 10273, 11558, 14742, 20701, 28019, 30444, 39680, 46534, 49856, 62350, 71394, 86977, 111352, 124421, 130649, 145076, 151939, 167759, 236113, 257098, 291830, 302611, 370060, 382610, 427214, 475078
Offset: 1

Views

Author

Antti Karttunen, Dec 14 2014

Keywords

Crossrefs

Column 8 of A249822.
Cf. also A250474 (column 4), A250477 (column 6).

Programs

  • PARI
    allocatemem(234567890);
    A002110(n) = prod(i=1, n, prime(i));
    A250478(n) = { my(p3); p3 = (prime(n)^3); sumdiv(A002110(n-1), d, (moebius(d)*(p3\d))); };
    for(n=1, 23, print1(A250478(n),", "));
    
  • Scheme
    (define (A250478 n) (A078898 (A030514 n)))

Formula

a(n) = A078898(A030514(n)).
a(1) = 1, a(n) = sum_{d | A002110(n-1)} moebius(d) * floor(prime(n)^3 / d). [Follows when A030514, prime(n)^4 is substituted to the similar formula given for A078898. Here A002110(n) gives the product of the first n primes. Because the latter is always squarefree, one could use here also Liouville's lambda (A008836) instead of Moebius mu (A008683).]

Extensions

More terms from Jon E. Schoenfield, Dec 14 2014

A256449 a(n) = A256447(n) - A256448(n).

Original entry on oeis.org

3, 2, 1, 0, 2, -3, 2, 0, 0, 3, 0, 1, 5, 3, -1, -3, 3, -1, -1, 3, 1, 0, -7, -10, 4, 5, 0, -1, -1, -31, -2, 0, -2, -14, -3, 1, -5, 5, 9, 0, 7, 7, 6, 5, 4, -6, -22, 5, 9, 7, -9, -1, -3, -6, 9, -15, 2, 5, 14, -4, 11, -24, 13, 0, 4, -9, -8, -10, 6, -2, 0, -2, 16, 11, -7, -13, 7, -11, 0
Offset: 1

Views

Author

Antti Karttunen, Mar 29 2015

Keywords

Comments

Positions of zeros: 4, 8, 9, 11, 22, 27, 32, 40, 64, 71, 79, 104, 113, 126, 140, 201, 225, 332, 333, 394, 451, ...
Corresponding primes: 7, 19, 23, 31, 79, 103, 131, 173, 311, 353, 401, 569, 617, 701, 809, 1229, 1427, 2237, 2239, 2707, 3187, ...

Crossrefs

Programs

Formula

a(n) = A256447(n) - A256448(n).
a(n) = 2*A250477(n) - A250474(n) - A250474(n+1).
a(n) = 3 - A256470(n).
Showing 1-9 of 9 results.