OFFSET
1,1
COMMENTS
Last digit of triprimes (A014612).
LINKS
FORMULA
MAPLE
MATHEMATICA
Mod[#, 10] & /@ Select[Range[500], PrimeOmega[#] == 3 &]
PROG
(Haskell)
a253721 = flip mod 10 . a014612 -- Reinhard Zumkeller, May 05 2015
(PARI) do(x)=my(v=List(), t); forprime(p=2, x\4, forprime(q=2, min(x\(2*p), p), t=p*q; forprime(r=2, min(x\t, q), listput(v, t*r)))); Set(v)%10 \\ Charles R Greathouse IV, Aug 30 2017
(Python)
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
def A253721(n):
def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a, k in enumerate(primerange(integer_nthroot(x, 3)[0]+1)) for b, m in enumerate(primerange(k, isqrt(x//k)+1), a)))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m%10 # Chai Wah Wu, Aug 17 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Wesley Ivan Hurt, May 02 2015
STATUS
approved