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.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..3460
FORMULA
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
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 21 2014
STATUS
approved