login
A242734
a(n) = (smallest prime > (3/2)^n) - floor((3/2)^n).
3
1, 1, 2, 2, 4, 2, 2, 4, 3, 2, 3, 2, 3, 2, 2, 3, 6, 4, 5, 4, 6, 6, 17, 9, 2, 3, 6, 1, 3, 22, 3, 2, 2, 8, 12, 15, 7, 4, 17, 25, 41, 20, 11, 23, 22, 54, 3, 28, 3, 7, 43, 14, 24, 13, 6, 61, 10, 10, 30, 17, 4, 8, 4, 32, 68, 1, 21, 29, 28, 17, 16, 23, 17, 46, 69, 22
OFFSET
1,3
COMMENTS
The smallest integer x and the smallest integer y such that a(n) + floor((y/x)^n) gives, without repetition, the first 6 primes 2, 3, 5, 7, 11, 13 for n = 1..6 are 2 for x and 3 for y, the first two primes.
The ratio sum(a(n))/sum(n) for n=1..N tends to log(3/2) as N increases and floor(5*log(3/2))/5 = 2/5.
FORMULA
a(n) = A242738(n) - A002379(n). - Jinyuan Wang, Jul 29 2019
EXAMPLE
2 - floor((3/2)^1) = 1 so a(1)=1;
3 - floor((3/2)^2) = 1 so a(2)=1;
5 - floor((2/3)^2) = 2 so a(3)=2.
MATHEMATICA
spg[n_]:=With[{c=(3/2)^n}, NextPrime[c]-Floor[c]]; Array[spg, 100] (* Harvey P. Dale, May 11 2021 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i
DIM k, 0
DIM n
DIM q
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET k, k+1
SET i, 0
SET n, 3^k/2^k
LABEL loop2
SET i, i+1
SET q, n+i
SETS t, %d\ ; i
PRP q, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, i
GOTO loop1
(PARI) a(n) = nextprime((3/2)^n) - floor((3/2)^n); \\ Jinyuan Wang, Jul 29 2019
(Magma) [NextPrime(Floor((3/2)^n)) - Floor((3/2)^n):n in [1..76]]; // Marius A. Burtea, Jul 29 2019
CROSSREFS
Sequence in context: A212595 A087692 A093621 * A309709 A143230 A276604
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 21 2014
STATUS
approved