OFFSET
1,2
COMMENTS
Successive k such that phi(35*k) = 24*k: 35*a(n) = A033851(n). - Artur Jasinski, Nov 09 2008
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Alois P. Heinz)
Vaclav Kotesovec, Graph - the asymptotic ratio (400000 terms).
David Ryan, An algorithm to assign musical prime commas to every prime number and construct a universal and compact free Just Intonation musical notation, Preprint, arXiv:1612.01860 [cs.SD], 2016-2017.
FORMULA
Sum_{n>=1} 1/a(n) = (5*7)/((5-1)*(7-1)) = 35/24. - Amiram Eldar, Sep 22 2020
a(n) ~ exp(sqrt(2*log(5)*log(7)*n)) / sqrt(35). - Vaclav Kotesovec, Sep 22 2020
MATHEMATICA
a = {}; Do[If[EulerPhi[35 k] == 24 k, AppendTo[a, k]], {k, 1, 10000}]; a (* Artur Jasinski, Nov 09 2008 *)
fQ[n_] := PowerMod[35, n, n] == 0; Select[Range[600000], fQ] (* Bruno Berselli, Sep 24 2012 *)
PROG
(PARI) list(lim)=my(v=List(), N); for(n=0, log(lim)\log(7), N=7^n; while(N<=lim, listput(v, N); N*=5)); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jun 28 2011
(Magma) [n: n in [1..600000] | PrimeDivisors(n) subset [5, 7]]; // Bruno Berselli, Sep 24 2012
(Haskell)
import Data.Set (singleton, deleteFindMin, insert)
a003595 n = a003595_list !! (n-1)
a003595_list = f $ singleton 1 where
f s = y : f (insert (5 * y) $ insert (7 * y) s')
where (y, s') = deleteFindMin s
-- Reinhard Zumkeller, May 16 2015
(Python)
from sympy import integer_log
def A003595(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x): return n+x-sum(integer_log(x//7**i, 5)[0]+1 for i in range(integer_log(x, 7)[0]+1))
return bisection(f, n, n) # Chai Wah Wu, Sep 16 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved