OFFSET
0
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10080
FORMULA
MATHEMATICA
a[n_] := Module[{k = n, m = 2, c = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r == 1, c++]; m++]; If[c > 0, 1, 0]]; Array[a, 100, 0] (* Amiram Eldar, Jan 23 2024 *)
PROG
(Scheme)
(define (A257680 n) (let loop ((n n) (i 2)) (cond ((zero? n) 0) ((= 1 (modulo n i)) 1) (else (loop (floor->exact (/ n i)) (+ 1 i))))))
;; As a recurrence utilizing memoizing definec-macro:
(Python)
def a007623(n, p=2): return n if n<p else a007623(n//p, p+1)*10 + n%p
def a(n): return 1 if '1' in str(a007623(n)) else 0
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, May 04 2015
STATUS
approved