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.

User: Freimut Marschner

Freimut Marschner's wiki page.

Freimut Marschner has authored 37 sequences. Here are the ten most recent ones:

A250623 a(n) = floor(n*log(prime(n))) + ceiling(n*log(n)) - 2*prime(n).

Original entry on oeis.org

-4, -2, -2, -1, -2, 0, -1, 2, 2, -1, 2, -1, 0, 3, 4, 2, 0, 4, 1, 3, 8, 7, 8, 6, 1, 2, 8, 10, 16, 18, 3, 5, 4, 9, 2, 8, 7, 6, 8, 8, 7, 13, 5, 12, 15, 22, 10, -1, 2, 9, 13, 12, 19, 12, 12, 12, 11, 18, 18, 22, 29, 22, 8, 12, 19, 23, 8, 8, 2, 9, 13, 13, 11, 11, 11
Offset: 1

Author

Freimut Marschner, Dec 02 2014

Keywords

Comments

It is known that n*log(n) < prime(n) < n*prime(n), n >= 4. The arithmetic mean of the limits of this inequality is f(n) = (floor((n*log(n)) + ceiling(n*prime(n))))/2. So a(n) is the difference between twice this quantity and 2*prime(n).

Examples

			a(4) = floor(4*log(7)) + ceiling(4*log(4)) - 2*7 = floor(7.78...) + ceiling(5.54...) - 14 = 7 + 6 - 14 = -1;
a(6) = floor(6*log(13)) + ceiling(6*log(6)) - 2*13 = floor(15.38...) + ceiling(10.75..) - 26 = 15 + 11 - 26 = 0.
		

Programs

  • Mathematica
    a250623[n_] :=
    Floor[#*Log[Prime[#]]] + Ceiling[#*Log[#]] - 2*Prime[#] & /@ Range[n]; a250623[137] (* Michael De Vlieger, Dec 26 2014 *)
  • PARI
    vector(100,n,floor(n*log(prime(n)))+ceil(n*log(n))-2*prime(n)) \\ Derek Orr, Dec 30 2014

Formula

a(n) = A250621(n) + A050502(n) - 2*A000040(n).

A251482 a(n) = floor(prime(n)/log(n)) + ceiling(prime(n)/log(prime(n))) - 2*n, n >=2.

Original entry on oeis.org

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

Author

Freimut Marschner, Dec 07 2014

Keywords

Comments

The prime number theorem implies prime(n)/log(prime(n)) < n < prime(n)/log(n), n >= 2. From this follows a(n).

Examples

			a(4) = floor(5.04...) + ceiling(3.59...) - 2*4 = 5 + 4 - 2*4 = 1.
		

Crossrefs

Cf. A086861 (floor(prime(n)/log(prime(n)))), A085581 (floor(prime(n)/log(n))).
Cf. A087724 (-PrimePi(n) + floor(prime(n)/log(n)) - 2), A000720 (pi(n)).
Cf. A060715 (Number of primes between n and 2n exclusive).

Programs

  • Magma
    [Floor(NthPrime(n)/Log(n)) + Ceiling(NthPrime(n)/Log(NthPrime(n))) - 2*n: n in [2..100]]; // Vincenzo Librandi, Mar 25 2015
  • Mathematica
    a251482[n_Integer] :=
    Floor[Prime[#]/Log[#]] + Ceiling[Prime[#]/Log[Prime[#]]] - 2 # & /@
    Range[2, n]; a251482[100] (* Michael De Vlieger, Dec 15 2014 *)
  • PARI
    vector(100,n,floor(prime(n+1)/log(n+1))+ceil(prime(n+1)/log(prime(n+1)))-2*n-2) \\ Derek Orr, Dec 30 2014
    

Formula

a(n) = A085581(n) + (A086861(n) + 1) - 2*n.

A250622 a(n) = floor(n*log(prime(n)))-prime(n), n >= 1.

Original entry on oeis.org

-2, -1, -1, 0, 0, 2, 2, 4, 5, 4, 6, 6, 7, 9, 10, 10, 10, 12, 12, 14, 17, 17, 18, 18, 17, 18, 22, 23, 27, 28, 23, 25, 25, 28, 26, 29, 30, 30, 32, 33, 33, 37, 34, 38, 40, 44, 40, 36, 38, 42, 45, 45, 49, 47, 48, 49, 49, 53, 54, 57, 61, 59, 53, 56, 60, 63, 57, 58, 56, 60, 63, 64, 64, 65, 66, 69, 70, 69
Offset: 1

Author

Freimut Marschner, Dec 02 2014

Keywords

Comments

Since n*log(prime(n)) > prime(n), n >= 4 and ceiling(prime(n) - n*log(n)) < prime(n), then n*log(n) < prime(n) < n*log(prime(n)), n >= 4. This inequality is included in the prime number theorem PNT. Remark: a(n) >= 0 for n >=4 otherwise a(n) < 0.

Examples

			n = 1, a(1) = floor(1*0.6931...) - 2 = 0 - 2 = -2;
n = 5, a(5) = floor(5*2.3978...) - 11 = floor( 11.9894...) - 11 = 11 - 11 = 0;
n = 6, a(6) = floor(6*2.5649...) - 13 = floor(15.3896...) - 13 = 15 - 13 = 2.
		

Crossrefs

Cf. A000040, A064658 (ceiling(prime(n) - n*log(n))), A250621 (floor(n*log(prime(n)))).

Programs

  • Mathematica
    a250622[n_Integer] := Table[Floor[i*Log[Prime[i]]] - Prime[i], {i, n}]; a250622[121] (* Michael De Vlieger, Dec 11 2014 *)
  • PARI
    vector(100,n,floor(n*log(prime(n))-prime(n))) \\ Derek Orr, Dec 13 2014

Formula

a(n) = floor(n*log(prime(n))) - prime(n) = A250621(n) - A000040(n).

A250621 a(n) = floor(n*log(prime(n))).

Original entry on oeis.org

0, 2, 4, 7, 11, 15, 19, 23, 28, 33, 37, 43, 48, 52, 57, 63, 69, 73, 79, 85, 90, 96, 101, 107, 114, 119, 125, 130, 136, 141, 150, 156, 162, 167, 175, 180, 187, 193, 199, 206, 212, 218, 225, 231, 237, 243, 251, 259, 265, 271, 278, 284, 290, 298, 305, 312, 318, 324, 331
Offset: 1

Author

Freimut Marschner, Nov 26 2014

Keywords

Comments

From n < prime(n), n >= 1 follows that n*log(n) < prime(n) < n*log(prime(n)), n >= 4. This inequality is included in the prime number theorem PNT.

Examples

			For n = 1, prime(1) = 2, floor(1*0.69... = 0.69...) = 0 ;
For n = 25, prime(25) = 97, floor(25*4.57... = 114.36...) = 114.
		

Crossrefs

Cf. A050504 (floor(n*log(n))), A086861 (floor(prime(n)/log(prime(n)))), A085581 (floor(prime(n)/log(n))), A050504 (integer part of n*log(n)), A050503 (nearest integer to n*log(n)), A050502 (ceiling of n*log(n)).

Programs

  • Mathematica
    Table[Floor[n Log[Prime[n]]],{n,60}] (* Harvey P. Dale, Aug 13 2019 *)
  • PARI
    vector(100,n,floor(n*log(prime(n)))) \\ Derek Orr, Nov 28 2014

A247583 Primes extracted from a pseudo-Collatz cycle '3*n-1' by consecutive arithmetic derivatives, here with starting point prime(99147) = 1287511.

Original entry on oeis.org

1287511, 1448449, 2172673, 37122139, 44596859, 91644073, 28996757, 3440533, 3870599, 4354423, 3265817, 7348087, 8266597, 9299921, 20924821, 31387231, 17655317, 19862231, 22345009, 33517513, 50276269, 75414403, 21499669, 34438309, 55163509, 9817919
Offset: 1

Author

Freimut Marschner, Sep 21 2014

Keywords

Comments

a(n) is defined as a sequence of subsequences of prime numbers extracted from the pseudo-Collatz cycle '3*n-1' , C = c(z) by consecutive arithmetic derivatives AD(i) of C. The starting point here is c(1) = prime(99147) = 1287511, the length is z = 560. The arithmetic derivative AD(i), i >=0 is a tool to select prime numbers out of a given sequence of integers, because the AD of prime numbers is 1.
Let AD(i,C(k)) be the i-th AD of the AD of C(k), then AD(1,C(k)) is the first AD of C(k) with AD(0,C(k)) = C(k). So a(n) = AD(i,C(k)) is a sequence of consecutive values of AD(i) of C(k).
The selection of the prime numbers can be made under the conditions:
(1) If AD(i+1,C(k)) = 1 then AD(i,C(k)) is prime.
(2) If AD(i,C(k)) mod 2 = 1 and AD(i,C(k)) > AD(i+1,C(k)) then AD(i,C(k)) is uneven and is (probably) convergent to a prime number.
(3) If AD(i,C(k)) mod 2 = 0 and AD(i,C(k)) < AD(i+1,C(k)) then AD(i) is even and (probably) divergent.
If any of the conditions 1 - 3 are not satisfied then the search for primes by AD in that sequence is hopeless.
In Tables 1 and 3, i is the number of the AD, np the counting number of primes of the AD and a(n) the last prime number of the i'th AD.
Table 1
i 0 1 2 3 4 5 6 7 8 9 10 ...
np 65 33 27 19 10 10 1 3 4 2 0 ...
n 65 98 125 144 154 164 165 168 172 174
a(n) 17 19 103 71 5 7 101 271 967721 5

Examples

			Example for starting point prime(7) = 17. This pseudo-Collatz cycle is repetitive (see A246007).
Table 2
Number         1    2  3   4   5     6   7     8   9  10  11 12   13 14   15   16 17  18  19
Sequence      17   50 25  74  37   110  55   164  82  41 122 61  182 91  272  136 68  34  17
Primes( AD)   17   37 41  61  17    43 131    19   7
Table 3
i        0    1  2  3 ...
np       5    3  1  0 ...
n        5    8  9
a(n)    17   19  7
		

Crossrefs

Cf. A246007 (length of pseudo-Collatz cycles '3*n - 1' of prime numbers).

A246010 a(n) = floor(5*prime(n)^2 / 4).

Original entry on oeis.org

5, 11, 31, 61, 151, 211, 361, 451, 661, 1051, 1201, 1711, 2101, 2311, 2761, 3511, 4351, 4651, 5611, 6301, 6661, 7801, 8611, 9901, 11761, 12751, 13261, 14311, 14851, 15961, 20161, 21451, 23461, 24151, 27751, 28501, 30811, 33211
Offset: 1

Author

Freimut Marschner, Sep 28 2014

Keywords

Comments

Let f(x) = -x^2 + b*x + b^2 be a polynomial function with b = prime(n), n >= 1, then the vertex of the graph of f(x) is at the point (vx;f(vx)) = (b/2;5*b^2/4) with f’(vx) = -2*vx + b = 0. If b = n, n >= 0, then the sequence of the vertex of this polynomial is A032527, the concentric pentagonal numbers: floor( 5*n^2 / 4). So a(n) = floor( 5*prime(n)^2 / 4), n >= 1 is a subsequence of A032527.

Examples

			a(4) = floor(5*7^2 / 4) = floor(61.25) = 61.
		

Crossrefs

Cf. A032527 (the concentric pentagonal numbers: floor( 5*n^2 / 4)).

Programs

  • Magma
    [Floor(5*NthPrime(n)^2 / 4): n in [1..40]]; // Vincenzo Librandi, Oct 21 2014
  • Mathematica
    Floor[(5*Prime[Range[40]]^2)/4] (* Harvey P. Dale, Sep 15 2019 *)
  • PARI
    vector(100,n,floor(5*prime(n)^2/4)) \\ Derek Orr, Sep 30 2014
    

Formula

a(n) = A032527(A000040(n)). - Michel Marcus, Sep 30 2014

A246009 Length of Collatz cycles '3*n + 1' of prime numbers.

Original entry on oeis.org

2, 8, 6, 17, 15, 10, 13, 21, 16, 19, 107, 22, 110, 30, 105, 12, 33, 20, 28, 103, 116, 36, 111, 31, 119, 26, 88, 101, 114, 13, 47, 29, 91, 42, 24, 16, 37, 24, 68, 32, 32, 19, 45, 120, 27, 120, 40, 71, 14, 35, 84, 53, 22, 66, 123, 79, 30, 43, 17, 43, 61, 118, 38, 87, 131, 38, 25, 113, 126, 33, 126, 51, 46, 20, 59
Offset: 1

Author

Freimut Marschner, Aug 12 2014

Keywords

Comments

Define a Collatz cycle C(prime(n)) = {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) + 1}, z >= 1, c(1) = prime(n), n >= 1}; then the length of C(prime(n)) depends only on the starting point c(1) if C ends with c(z) = 1. The length of C(prime(n)) is z, so a(n) = z.
The longest C(prime(n)) out of 10^5 prime numbers is C(prime(96648)) = C(1252663) with a(96648) = 510.
Until now C is not proved mathematically. So if the ending point c(z) is not equal to 1 then C(prime(n)) is not a 'true' Collatz cycle or does not exist.

Examples

			a(1) = {c(1) = prime(1) = 2, 2 mod 2 = 0, c(2) = 2/2 = 1, z=2} = 2;
a(3) = {c(1) = prime(3) = 5, 5 mod 2 = 1, c(2) = 3*5 + 1 = 16; 16 mod 2 = 0, c(3) = 16/2 = 8; 8 mod 2 = 0, c(4) = 8/2 = 4; 4 mod 2 = 0, c(5) = 4/2 = 2; 2 mod 2 = 0, c(6) = 2/2 = 1, z=6} = 6.
		

Crossrefs

A006577 (Number of halving and tripling steps to reach 1 in '3x+1' problem), A070975 (Number of steps to reach 1 in '3x+1' (or Collatz) problem starting with prime(n)).

Programs

  • PARI
    a(n)=n=prime(n);A=List;while(n != 1,listput(A,n);if(n%2==0,n=n/2,n=3*n+1));listput(A,1);return(#Vec(A)) \\ Edward Jiang, Sep 06 2014

Formula

a(n) = z where {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) + 1}, z >= 1, c(1) = prime(n), n >= 1}, a(n) = A006577(prime(n)) + 1 = A070975(n) + 1.

A246007 Length of pseudo-Collatz cycles '3*n - 1' of prime numbers.

Original entry on oeis.org

2, 5, 3, 6, 7, 7, 19, 5, 4, 11, 7, 15, 10, 9, 14, 17, 12, 8, 21, 20, 16, 15, 11, 33, 36, 36, 18, 10, 14, 31, 26, 22, 21, 13, 26, 34, 16, 12, 21, 42, 25, 16, 16, 37, 20, 29, 19, 24, 32, 90, 28, 28, 19, 19, 85, 23, 40, 14, 36, 27, 22, 49, 17, 31, 31, 40, 13, 44, 43, 26, 66, 43, 25, 25, 25, 30, 21, 30, 30, 51, 20, 25, 25, 33, 47, 16, 47, 91, 46, 46, 29, 46, 28
Offset: 1

Author

Freimut Marschner, Aug 10 2014

Keywords

Comments

Define a pseudo-Collatz cycle C(prime(n)) = {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) - 1}, z >= 1, c(1) = prime(n), n >= 1} depending of the starting point c(1). If c(1) = prime(n) then c(z) might be
(1) finite convergent to c(z) = 1 or
(2) infinite periodic from c(z) = 7 or from c(z) = 17 or
(3) no cycle if c(z) = -1.
The case (3) is not observed out of 10^5 prime numbers. So a(n) = z is the length of the C(prime(n)) up to the stoppping point, where c(z) = 1 or up to the periodical point, where c(z) = 7 or c(z) = 17 or c(z) = c(1). See Table for examples of cases (1) and (2). The longest sequence here is a(99147) = 560 with starting point c(1) = prime(99147) = 1287511 up to the periodical point c(560) = 17.

Examples

			a(1) = {c(1) = prime(1) = 2, 2 mod 2 = 0, c(2) = 2/2 = 1, z=2} = 2.
Table for cases (1) and (2):
case (1)
c(1) = prime(2) = 3
z    1 2 3 4 5
c(z) 3 8 4 2 1
a(2) = 5
c(1) = prime(3) = 5
z    1  2 3
c(z) 5 14 7
a(3) = 3
c(1) = prime(10) = 29
z     1  2  3   4  5  6  7 8 9 10 11
c(z) 29 86 43 128 64 32 16 8 4  2  1
a(10) = 11
case (2)
c(1) = prime(4) = 7
z    1  2  3 4  5 6  7 ...
c(z) 7 20 10 5 14 7 20 ...
a(4) = 6
c(1) = prime(7) = 17
z     1  2  3  4  5   6  7   8  9 10  11 12  13
c(z) 17 50 25 74 37 110 55 164 82 41 122 61 182
z    14  15  16 17 18 19 20 ...
c(z) 91 272 136 68 34 17 50 ...
a(7) = 19
		

Crossrefs

A003627 (Primes of form 3n-1), A006370 (Image of n under the '3x+1' map), A014682 (The Collatz or 3x+1 function: a(n) = n/2 if n is even, otherwise (3n+1)/2), A006577(Number of halving and tripling steps to reach 1 in '3x+1' problem), A016789({3n+2, n >=0} = {3n-1, n >= 1}).

Formula

a(n) = z where {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) - 1}, z >= 1, c(1) = prime(n), n>= 1}.

A245838 Arithmetic derivative of (3*n + 1), n >= 1, (A016777)'.

Original entry on oeis.org

4, 1, 7, 1, 32, 1, 13, 10, 32, 1, 19, 1, 68, 1, 25, 14, 56, 16, 31, 1, 192, 1, 59, 1, 80, 1, 43, 22, 140, 20, 49, 1, 140, 1, 55, 1, 240, 28, 61, 22, 128, 1, 101, 26, 212, 1, 73, 34, 152, 1, 113, 1, 432, 1, 85, 26, 176, 95, 91, 1, 284, 28, 143, 1, 252, 1, 103
Offset: 1

Author

Freimut Marschner, Aug 06 2014

Keywords

Comments

Comparing A016777(n) = 3n+1 and its arithmetic derivative a(n) = (A016777(n))' allows us to select the primes in A016777, because (prime(n))' = 1.

Examples

			a(2) = (3*2 + 1)' = (7)' = 1, a(5846) = (A016777(5846))' = (3*5846 + 1)' = (17539)' = 1.
		

Crossrefs

Cf. A003415 (arithmetic derivative), A016777 (3n+1), A002476 (Primes of form 6m + 1).

Programs

  • Maple
    ad:= n -> n*add(f[2]/f[1], f=ifactors(n)[2]):
    seq(ad(3*n+1), n=1..100); # Robert Israel, Aug 25 2014
  • PARI
    a(n) = my(n=3*n+1);sum(i=1, #f=factor(n)~, n/f[1, i]*f[2, i]); \\ Michel Marcus, Aug 12 2014

Formula

a(n) = (3*n + 1)' = (A016777(n))' = A003415(A016777(n)).

Extensions

Edited: in name n>=0 replaced by n>=1. Example corrected. - Wolfdieter Lang, Oct 14 2014
Missing comma in data at a(63) inserted by Andrew Howroyd, Feb 22 2018

A245071 a(n) = 12n - prime(n).

Original entry on oeis.org

10, 21, 31, 41, 49, 59, 67, 77, 85, 91, 101, 107, 115, 125, 133, 139, 145, 155, 161, 169, 179, 185, 193, 199, 203, 211, 221, 229, 239, 247, 245, 253, 259, 269, 271, 281, 287, 293, 301, 307, 313, 323, 325, 335, 343, 353, 353, 353, 361, 371, 379, 385, 395, 397, 403, 409, 415, 425
Offset: 1

Author

Freimut Marschner, Jul 21 2014

Keywords

Comments

Prime(n) > n for n > 0. Let prime(n) = k*n with k as an even integer constant, for example, k = 12; then a(n) = k*n - prime(n) is a sequence of odd integers that are positive as long as k*n > prime(n). This is the case up to a(40072) = 11. If k*n < prime(n) then a(n) < 0, a(40073) = -5 up to a(40083) = -5. From a(40084) = 5 up to a(40121) = 5, a(n) > 0 again, but a(n) < 0 for n >= 40122. For k = 12 the table shows this result compared with floor(prime(n)/n) and (prime(n) mod n) <= (prime(n+1) mod (n+1)) for n >= 1. Observations:
(1) If k > floor(prime(n)/n) then a(n) is positive.
(2) If k <= floor(prime(n)/n) and (prime(n) mod n) < (prime(n+1) mod (n+1)) and n > 1 then a(n) is negative.
(3) If k <= floor(prime(n)/n) and (prime(n) mod n) > (prime(n+1) mod (n+1)) then a(n) is positive.
.
n prime(n) floor(prime(n)/n) (prime(n) mod n) a(n)
40072 480853 12 5 11
40073 480881 12 23 -5
40083 481001 11 40079 -5
40084 481003 11 40074 5
40121 481447 12 5 5
40122 481469 12 13 -5

Examples

			a(3) = 12*3 - prime(3) = 36 - 5 = 31.
		

Crossrefs

A000040 (prime(n)), A038605 (floor(prime(n)/n)), A004648 (prime(n) mod n), A038606 (Least k such that k-th prime > n * k), A038607 (the smallest prime number k such that k > n*pi(k)), A102281 (the largest number m such that m = pi(n*m)).

Programs

  • Mathematica
    Table[12n - Prime[n], {n, 60}] (* Alonso del Arte, Jul 27 2014 *)
  • PARI
    vector(133, n, 12*n-prime(n) )

Formula

a(n) = 12*n - prime(n).