OFFSET
0,2
REFERENCES
H. Ibstedt, Smarandache Primitive Numbers, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 216-229.
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1000
F. Smarandache, Only Problems, Not Solutions!
MATHEMATICA
lpi[n_]:=Module[{k = 1, n7 = 7^n}, While[! Divisible[k!, n7], k++]; k]; Array[lpi, 60, 0] (* Harvey P. Dale, Jun 29 2017 *)
PROG
(PARI) a(n) = {k = 1; while (valuation(k!, 7) < n, k++); k; } \\ Michel Marcus, Aug 19 2013
(Python)
from itertools import count
from sympy import multiplicity
def A020646(n):
if n == 0: return 1
c = 0
for k in count(7, 7):
c += multiplicity(7, k)
if c+k+7 > n:
return 7*(max(k, n-c) if n>=7 else n+1-c) # Chai Wah Wu, Feb 24 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved
